Skip to content

Commit

Permalink
do_wait: do take security_task_wait() into account
Browse files Browse the repository at this point in the history
I was never able to understand what should we actually do when
security_task_wait() fails, but the current code doesn't look right.

If ->task_wait() returns the error, we update *notask_error correctly.
But then we either reap the child (despite the fact this was forbidden)
or clear *notask_error (and hide the securiy policy problems).

This patch assumes that "stolen by ptrace" doesn't matter. If selinux
denies the child we should ignore it but make sure we report -EACCESS
instead of -ECHLD if there are no other eligible children.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
  • Loading branch information
Oleg Nesterov authored and James Morris committed Apr 30, 2009
1 parent ecd6de3 commit 78a3d9d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,7 @@ static int wait_consider_task(struct task_struct *parent, int ptrace,
*/
if (*notask_error)
*notask_error = ret;
return 0;
}

if (likely(!ptrace) && unlikely(p->ptrace)) {
Expand Down

0 comments on commit 78a3d9d

Please sign in to comment.