Re: 2.6.35+vfs-scale: INFO: suspicious rcu_dereference_check()usage (kernel/exit.c:1387)

From: Oleg Nesterov
Date: Tue Aug 17 2010 - 14:12:47 EST


On 08/16, David Howells wrote:
>
> Vegard Nossum <vegard.nossum@xxxxxxxxx> wrote:
>
> --- a/kernel/exit.c
> +++ b/kernel/exit.c
> @@ -1386,8 +1386,7 @@ static int wait_task_stopped(struct wait_opts *wo,
> if (!unlikely(wo->wo_flags & WNOWAIT))
> *p_code = 0;
>
> - /* don't need the RCU readlock here as we're holding a spinlock */
> - uid = __task_cred(p)->uid;
> + uid = task_uid(p);
> unlock_sig:
> spin_unlock_irq(&p->sighand->siglock);
> if (!exit_code)
> @@ -1460,7 +1459,7 @@ static int wait_task_continued(struct wait_opts *wo, struct task_struct *p)
> }
> if (!unlikely(wo->wo_flags & WNOWAIT))
> p->signal->flags &= ~SIGNAL_STOP_CONTINUED;
> - uid = __task_cred(p)->uid;
> + uid = task_uid(p);
> spin_unlock_irq(&p->sighand->siglock);
>
> pid = task_pid_vnr(p);

Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx>


Vegard, perhaps you can take care of wait_task_zombie() too?
Of course, if you wish.

Like wait_task_stopped(), it doesn't really need RCU lock. But if
we change it to use task_uid() to shut up rcu_dereference_check(),
then we can kill task_is_dead().

Oleg.

--
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/