do_wait: do take security_task_wait() into account
authorOleg Nesterov <oleg@redhat.com>
Wed, 29 Apr 2009 16:01:23 +0000 (18:01 +0200)
committerJames Morris <jmorris@namei.org>
Thu, 30 Apr 2009 22:49:29 +0000 (08:49 +1000)
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>
kernel/exit.c

index 167e1e3..d2e8239 100644 (file)
@@ -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)) {