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
4c48abe9
Commit
4c48abe9
authored
May 14, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
waitid(): switch copyout of siginfo to unsafe_put_user()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
76d9871e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
15 deletions
+25
-15
kernel/exit.c
kernel/exit.c
+25
-15
No files found.
kernel/exit.c
View file @
4c48abe9
...
...
@@ -1625,15 +1625,18 @@ SYSCALL_DEFINE5(waitid, int, which, pid_t, upid, struct siginfo __user *,
if
(
!
infop
)
return
err
;
if
(
put_user
(
err
?
0
:
SIGCHLD
,
&
infop
->
si_signo
)
||
put_user
(
0
,
&
infop
->
si_errno
)
||
put_user
((
short
)
info
.
cause
,
&
infop
->
si_code
)
||
put_user
(
info
.
pid
,
&
infop
->
si_pid
)
||
put_user
(
info
.
uid
,
&
infop
->
si_uid
)
||
put_user
(
info
.
status
,
&
infop
->
si_status
))
err
=
-
EFAULT
;
user_access_begin
();
unsafe_put_user
(
err
?
0
:
SIGCHLD
,
&
infop
->
si_signo
,
Efault
);
unsafe_put_user
(
0
,
&
infop
->
si_errno
,
Efault
);
unsafe_put_user
((
short
)
info
.
cause
,
&
infop
->
si_code
,
Efault
);
unsafe_put_user
(
info
.
pid
,
&
infop
->
si_pid
,
Efault
);
unsafe_put_user
(
info
.
uid
,
&
infop
->
si_uid
,
Efault
);
unsafe_put_user
(
info
.
status
,
&
infop
->
si_status
,
Efault
)
;
user_access_end
();
return
err
;
Efault:
user_access_end
();
return
-
EFAULT
;
}
static
long
kernel_wait4
(
pid_t
upid
,
int
__user
*
stat_addr
,
...
...
@@ -1736,13 +1739,20 @@ COMPAT_SYSCALL_DEFINE5(waitid,
return
-
EFAULT
;
}
if
(
put_user
(
err
?
0
:
SIGCHLD
,
&
infop
->
si_signo
)
||
put_user
(
0
,
&
infop
->
si_errno
)
||
put_user
((
short
)
info
.
cause
,
&
infop
->
si_code
)
||
put_user
(
info
.
pid
,
&
infop
->
si_pid
)
||
put_user
(
info
.
uid
,
&
infop
->
si_uid
)
||
put_user
(
info
.
status
,
&
infop
->
si_status
))
err
=
-
EFAULT
;
if
(
!
infop
)
return
err
;
user_access_begin
();
unsafe_put_user
(
err
?
0
:
SIGCHLD
,
&
infop
->
si_signo
,
Efault
);
unsafe_put_user
(
0
,
&
infop
->
si_errno
,
Efault
);
unsafe_put_user
((
short
)
info
.
cause
,
&
infop
->
si_code
,
Efault
);
unsafe_put_user
(
info
.
pid
,
&
infop
->
si_pid
,
Efault
);
unsafe_put_user
(
info
.
uid
,
&
infop
->
si_uid
,
Efault
);
unsafe_put_user
(
info
.
status
,
&
infop
->
si_status
,
Efault
);
user_access_end
();
return
err
;
Efault:
user_access_end
();
return
-
EFAULT
;
}
#endif
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