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
nexedi
linux
Commits
5c1f1780
Commit
5c1f1780
authored
Feb 15, 2020
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x86: __setup_frame(): consolidate uaccess areas
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
b00d8f8f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
17 deletions
+6
-17
arch/x86/kernel/signal.c
arch/x86/kernel/signal.c
+6
-17
No files found.
arch/x86/kernel/signal.c
View file @
5c1f1780
...
...
@@ -302,25 +302,16 @@ __setup_frame(int sig, struct ksignal *ksig, sigset_t *set,
{
struct
sigframe
__user
*
frame
;
void
__user
*
restorer
;
int
err
=
0
;
void
__user
*
fp
=
NULL
;
frame
=
get_sigframe
(
&
ksig
->
ka
,
regs
,
sizeof
(
*
frame
),
&
fp
);
if
(
!
access_ok
(
frame
,
sizeof
(
*
frame
)))
return
-
EFAULT
;
if
(
__put_user
(
sig
,
&
frame
->
sig
))
if
(
!
user_access_begin
(
frame
,
sizeof
(
*
frame
)))
return
-
EFAULT
;
if
(
!
user_access_begin
(
&
frame
->
sc
,
sizeof
(
struct
sigcontext
)))
return
-
EFAULT
;
unsafe_put_user
(
sig
,
&
frame
->
sig
,
Efault
);
unsafe_put_sigcontext
(
&
frame
->
sc
,
fp
,
regs
,
set
,
Efault
);
user_access_end
();
if
(
__put_user
(
set
->
sig
[
1
],
&
frame
->
extramask
[
0
]))
return
-
EFAULT
;
unsafe_put_user
(
set
->
sig
[
1
],
&
frame
->
extramask
[
0
],
Efault
);
if
(
current
->
mm
->
context
.
vdso
)
restorer
=
current
->
mm
->
context
.
vdso
+
vdso_image_32
.
sym___kernel_sigreturn
;
...
...
@@ -330,7 +321,7 @@ __setup_frame(int sig, struct ksignal *ksig, sigset_t *set,
restorer
=
ksig
->
ka
.
sa
.
sa_restorer
;
/* Set up to return from userspace. */
err
|=
__put_user
(
restorer
,
&
frame
->
pretcode
);
unsafe_put_user
(
restorer
,
&
frame
->
pretcode
,
Efault
);
/*
* This is popl %eax ; movl $__NR_sigreturn, %eax ; int $0x80
...
...
@@ -339,10 +330,8 @@ __setup_frame(int sig, struct ksignal *ksig, sigset_t *set,
* reasons and because gdb uses it as a signature to notice
* signal handler stack frames.
*/
err
|=
__put_user
(
*
((
u64
*
)
&
retcode
),
(
u64
*
)
frame
->
retcode
);
if
(
err
)
return
-
EFAULT
;
unsafe_put_user
(
*
((
u64
*
)
&
retcode
),
(
u64
*
)
frame
->
retcode
,
Efault
);
user_access_end
();
/* Set up registers for signal handler */
regs
->
sp
=
(
unsigned
long
)
frame
;
...
...
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