public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: suspicious rcu_dereference_check() usage splat
Date: Tue, 9 Nov 2010 12:20:51 -0800	[thread overview]
Message-ID: <20101109202051.GT4032@linux.vnet.ibm.com> (raw)
In-Reply-To: <20101109090931.GH3971@swordfish.minsk.epam.com>

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

      reply	other threads:[~2010-11-09 20:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-07  7:14 suspicious rcu_dereference_check() usage splat Arun Bhanu
2010-11-07 18:50 ` Paul E. McKenney
2010-11-08 15:39   ` Arun Bhanu
2010-11-08 20:24     ` Paul E. McKenney
2010-11-09  9:09       ` Sergey Senozhatsky
2010-11-09 20:20         ` Paul E. McKenney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101109202051.GT4032@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sergey.senozhatsky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox