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
359566fa
Commit
359566fa
authored
May 14, 2017
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel_wait4()/kernel_waitid(): delay copying status to userland
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
ce72a16f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
kernel/exit.c
kernel/exit.c
+8
-12
No files found.
kernel/exit.c
View file @
359566fa
...
@@ -1002,7 +1002,7 @@ struct wait_opts {
...
@@ -1002,7 +1002,7 @@ struct wait_opts {
struct
pid
*
wo_pid
;
struct
pid
*
wo_pid
;
struct
siginfo
__user
*
wo_info
;
struct
siginfo
__user
*
wo_info
;
int
__user
*
wo_stat
;
int
wo_stat
;
struct
rusage
*
wo_rusage
;
struct
rusage
*
wo_rusage
;
wait_queue_t
child_wait
;
wait_queue_t
child_wait
;
...
@@ -1189,8 +1189,7 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
...
@@ -1189,8 +1189,7 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
retval
=
0
;
retval
=
0
;
status
=
(
p
->
signal
->
flags
&
SIGNAL_GROUP_EXIT
)
status
=
(
p
->
signal
->
flags
&
SIGNAL_GROUP_EXIT
)
?
p
->
signal
->
group_exit_code
:
p
->
exit_code
;
?
p
->
signal
->
group_exit_code
:
p
->
exit_code
;
if
(
!
retval
&&
wo
->
wo_stat
)
wo
->
wo_stat
=
status
;
retval
=
put_user
(
status
,
wo
->
wo_stat
);
infop
=
wo
->
wo_info
;
infop
=
wo
->
wo_info
;
if
(
!
retval
&&
infop
)
if
(
!
retval
&&
infop
)
...
@@ -1322,8 +1321,7 @@ static int wait_task_stopped(struct wait_opts *wo,
...
@@ -1322,8 +1321,7 @@ static int wait_task_stopped(struct wait_opts *wo,
if
(
wo
->
wo_rusage
)
if
(
wo
->
wo_rusage
)
getrusage
(
p
,
RUSAGE_BOTH
,
wo
->
wo_rusage
);
getrusage
(
p
,
RUSAGE_BOTH
,
wo
->
wo_rusage
);
retval
=
0
;
retval
=
0
;
if
(
!
retval
&&
wo
->
wo_stat
)
wo
->
wo_stat
=
(
exit_code
<<
8
)
|
0x7f
;
retval
=
put_user
((
exit_code
<<
8
)
|
0x7f
,
wo
->
wo_stat
);
infop
=
wo
->
wo_info
;
infop
=
wo
->
wo_info
;
if
(
!
retval
&&
infop
)
if
(
!
retval
&&
infop
)
...
@@ -1383,12 +1381,9 @@ static int wait_task_continued(struct wait_opts *wo, struct task_struct *p)
...
@@ -1383,12 +1381,9 @@ static int wait_task_continued(struct wait_opts *wo, struct task_struct *p)
if
(
!
wo
->
wo_info
)
{
if
(
!
wo
->
wo_info
)
{
if
(
wo
->
wo_rusage
)
if
(
wo
->
wo_rusage
)
getrusage
(
p
,
RUSAGE_BOTH
,
wo
->
wo_rusage
);
getrusage
(
p
,
RUSAGE_BOTH
,
wo
->
wo_rusage
);
retval
=
0
;
put_task_struct
(
p
);
put_task_struct
(
p
);
if
(
!
retval
&&
wo
->
wo_stat
)
wo
->
wo_stat
=
0xffff
;
retval
=
put_user
(
0xffff
,
wo
->
wo_stat
);
retval
=
pid
;
if
(
!
retval
)
retval
=
pid
;
}
else
{
}
else
{
retval
=
wait_noreap_copyout
(
wo
,
p
,
pid
,
uid
,
retval
=
wait_noreap_copyout
(
wo
,
p
,
pid
,
uid
,
CLD_CONTINUED
,
SIGCONT
);
CLD_CONTINUED
,
SIGCONT
);
...
@@ -1662,7 +1657,6 @@ static long kernel_waitid(int which, pid_t upid, struct siginfo __user *infop,
...
@@ -1662,7 +1657,6 @@ static long kernel_waitid(int which, pid_t upid, struct siginfo __user *infop,
wo
.
wo_pid
=
pid
;
wo
.
wo_pid
=
pid
;
wo
.
wo_flags
=
options
;
wo
.
wo_flags
=
options
;
wo
.
wo_info
=
infop
;
wo
.
wo_info
=
infop
;
wo
.
wo_stat
=
NULL
;
wo
.
wo_rusage
=
ru
;
wo
.
wo_rusage
=
ru
;
ret
=
do_wait
(
&
wo
);
ret
=
do_wait
(
&
wo
);
...
@@ -1734,10 +1728,12 @@ static long kernel_wait4(pid_t upid, int __user *stat_addr,
...
@@ -1734,10 +1728,12 @@ static long kernel_wait4(pid_t upid, int __user *stat_addr,
wo
.
wo_pid
=
pid
;
wo
.
wo_pid
=
pid
;
wo
.
wo_flags
=
options
|
WEXITED
;
wo
.
wo_flags
=
options
|
WEXITED
;
wo
.
wo_info
=
NULL
;
wo
.
wo_info
=
NULL
;
wo
.
wo_stat
=
stat_addr
;
wo
.
wo_stat
=
0
;
wo
.
wo_rusage
=
ru
;
wo
.
wo_rusage
=
ru
;
ret
=
do_wait
(
&
wo
);
ret
=
do_wait
(
&
wo
);
put_pid
(
pid
);
put_pid
(
pid
);
if
(
ret
>
0
&&
stat_addr
&&
put_user
(
wo
.
wo_stat
,
stat_addr
))
ret
=
-
EFAULT
;
return
ret
;
return
ret
;
}
}
...
...
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