Re: suspicious rcu_dereference_check() usage splat

From: Paul E. McKenney
Date: Tue Nov 09 2010 - 15:21:40 EST


On Tue, Nov 09, 2010 at 11:09:31AM +0200, Sergey Senozhatsky wrote:
> On (11/08/10 12:24), Paul E. McKenney wrote:
> > Looking over the patch again, the scope of the RCU read-side critical
> > section needs to expand to cover the use of the pointer as well as the
> > call to find_task_by_vpid(). So, for example:
> >
> > case IOPRIO_WHO_PROCESS:
> > rcu_read_lock();
> > if (!who)
> > p = current;
> > else
> > p = find_task_by_vpid(who);
> > if (p)
> > ret = set_task_ioprio(p, ioprio);
> > rcu_read_unlock();
> > break;
> > case IOPRIO_WHO_PGRP:
> >
> >
> > Otherwise, the task could go away before the last use.
> >
> > Sergey, could you please make this change and re-post your patch?
> >
> > Thanx, Paul
> >
>
> Hello,
> Should we protect set_task_ioprio? Critical operations are protected
> with rcu_read_lock/rcu_read_unlock in set_task_ioprio, the rest is protected
> via task_lock(task)/task_unlock(task).

At first glance, this function's locking is OK, but I must defer to
people who know this code better than do I.

Thanx, Paul
--
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/