Commit 78a3d9d5 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by James Morris

do_wait: do take security_task_wait() into account

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: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarRoland McGrath <roland@redhat.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent ecd6de3c
...@@ -1582,6 +1582,7 @@ static int wait_consider_task(struct task_struct *parent, int ptrace, ...@@ -1582,6 +1582,7 @@ static int wait_consider_task(struct task_struct *parent, int ptrace,
*/ */
if (*notask_error) if (*notask_error)
*notask_error = ret; *notask_error = ret;
return 0;
} }
if (likely(!ptrace) && unlikely(p->ptrace)) { if (likely(!ptrace) && unlikely(p->ptrace)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment