Re: [PATCH 1/1] creds: kill __task_cred()->task_is_dead() validation

From: David Howells
Date: Wed Apr 11 2012 - 07:10:31 EST


Oleg Nesterov <oleg@xxxxxxxxxx> wrote:

> commit 8f92054e:
>
> add the following validation condition:
>
> task->exit_state >= 0
>
> to permit the access if the target task is dead and therefore
> unable to change its own credentials.
>
> OK, but afaics currently this can only help wait_task_zombie() which
> calls __task_cred() without rcu lock.
>
> Remove this validation and change wait_task_zombie() to use task_uid()
> instead. This means we do rcu_read_lock() only to shut up the lockdep,
> but we already do the same in, say, wait_task_stopped().
>
> task_is_dead() should die, task->exit_state != 0 means that this task
> has passed exit_notify(), only do_wait-like code paths should use this.
>
> Unfortunately, we can't kill task_is_dead() right now, it has already
> found the bugy users in drivers/staging/, the fix already exists.
>
> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

Acked-by: David Howells <dhowells@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/