Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
29bf5dd8
Commit
29bf5dd8
authored
May 02, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
blackfin: check __get_user() return value
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
35d51807
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
arch/blackfin/kernel/signal.c
arch/blackfin/kernel/signal.c
+14
-16
No files found.
arch/blackfin/kernel/signal.c
View file @
29bf5dd8
...
@@ -187,17 +187,22 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info,
...
@@ -187,17 +187,22 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info,
err
|=
copy_to_user
(
&
frame
->
uc
.
uc_sigmask
,
set
,
sizeof
(
*
set
));
err
|=
copy_to_user
(
&
frame
->
uc
.
uc_sigmask
,
set
,
sizeof
(
*
set
));
if
(
err
)
if
(
err
)
goto
give_sigsegv
;
return
-
EFAULT
;
/* Set up registers for signal handler */
/* Set up registers for signal handler */
wrusp
((
unsigned
long
)
frame
);
if
(
current
->
personality
&
FDPIC_FUNCPTRS
)
{
if
(
current
->
personality
&
FDPIC_FUNCPTRS
)
{
struct
fdpic_func_descriptor
__user
*
funcptr
=
struct
fdpic_func_descriptor
__user
*
funcptr
=
(
struct
fdpic_func_descriptor
*
)
ka
->
sa
.
sa_handler
;
(
struct
fdpic_func_descriptor
*
)
ka
->
sa
.
sa_handler
;
__get_user
(
regs
->
pc
,
&
funcptr
->
text
);
u32
pc
,
p3
;
__get_user
(
regs
->
p3
,
&
funcptr
->
GOT
);
err
|=
__get_user
(
pc
,
&
funcptr
->
text
);
err
|=
__get_user
(
p3
,
&
funcptr
->
GOT
);
if
(
err
)
return
-
EFAULT
;
regs
->
pc
=
pc
;
regs
->
p3
=
p3
;
}
else
}
else
regs
->
pc
=
(
unsigned
long
)
ka
->
sa
.
sa_handler
;
regs
->
pc
=
(
unsigned
long
)
ka
->
sa
.
sa_handler
;
wrusp
((
unsigned
long
)
frame
);
regs
->
rets
=
SIGRETURN_STUB
;
regs
->
rets
=
SIGRETURN_STUB
;
regs
->
r0
=
frame
->
sig
;
regs
->
r0
=
frame
->
sig
;
...
@@ -205,10 +210,6 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info,
...
@@ -205,10 +210,6 @@ setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t * info,
regs
->
r2
=
(
unsigned
long
)(
&
frame
->
uc
);
regs
->
r2
=
(
unsigned
long
)(
&
frame
->
uc
);
return
0
;
return
0
;
give_sigsegv:
force_sigsegv
(
sig
,
current
);
return
-
EFAULT
;
}
}
static
inline
void
static
inline
void
...
@@ -248,20 +249,17 @@ static void
...
@@ -248,20 +249,17 @@ static void
handle_signal
(
int
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
handle_signal
(
int
sig
,
siginfo_t
*
info
,
struct
k_sigaction
*
ka
,
struct
pt_regs
*
regs
)
struct
pt_regs
*
regs
)
{
{
int
ret
;
/* are we from a system call? to see pt_regs->orig_p0 */
/* are we from a system call? to see pt_regs->orig_p0 */
if
(
regs
->
orig_p0
>=
0
)
if
(
regs
->
orig_p0
>=
0
)
/* If so, check system call restarting.. */
/* If so, check system call restarting.. */
handle_restart
(
regs
,
ka
,
1
);
handle_restart
(
regs
,
ka
,
1
);
/* set up the stack frame */
/* set up the stack frame */
ret
=
setup_rt_frame
(
sig
,
ka
,
info
,
sigmask_to_save
(),
regs
);
if
(
setup_rt_frame
(
sig
,
ka
,
info
,
sigmask_to_save
(),
regs
)
<
0
)
if
(
ret
)
force_sigsegv
(
sig
,
current
);
return
;
else
signal_delivered
(
sig
,
info
,
ka
,
regs
,
signal_delivered
(
sig
,
info
,
ka
,
regs
,
test_thread_flag
(
TIF_SINGLESTEP
));
test_thread_flag
(
TIF_SINGLESTEP
));
}
}
/*
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment