netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Moore <paul.moore@hp.com>
To: paulmck@linux.vnet.ibm.com
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	David Howells <dhowells@redhat.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] NETLABEL: Fix an RCU warning
Date: Mon, 29 Mar 2010 16:05:48 -0400	[thread overview]
Message-ID: <201003291605.48605.paul.moore@hp.com> (raw)
In-Reply-To: <20100329155857.GG2569@linux.vnet.ibm.com>

On Monday 29 March 2010 11:58:57 am Paul E. McKenney wrote:
> On Mon, Mar 29, 2010 at 11:30:10AM -0400, Paul Moore wrote:
> > On Monday 29 March 2010 11:24:53 am Paul E. McKenney wrote:
> > > On Thu, Mar 25, 2010 at 12:28:04PM +0100, Eric Dumazet wrote:
> > > > Le jeudi 25 mars 2010 à 11:06 +0000, David Howells a écrit :
> > > > > Fix an RCU warning in the netlabel code due to missing rcu read
> > > > > locking around an rcu_dereference() in netlbl_unlhsh_hash() when
> > > > > called from netlbl_unlhsh_netdev_handler():
> > > > > 
> > > > > ===================================================
> > > > > [ INFO: suspicious rcu_dereference_check() usage. ]
> > > > > ---------------------------------------------------
> > > > > net/netlabel/netlabel_unlabeled.c:246 invoked
> > > > > rcu_dereference_check() without protection!

...

> > As Eric pointed out in response to the message above, I believe the
> > solution is to simply remove the rcu_dereference() call in the
> > netlbl_unlhsh_hash() function.
> 
> It would be at the moment, but this will break once Arnd Bergmann gets
> his sparse-based checks done.  With these checks, we decorate RCU-protected
> pointers, and then sparse yells if you access such a pointer without the
> proper rcu_dereference() invocation.

Okay, is there a recommended approach towards accessing RCU-protected pointers 
both under a RCU read lock and under only a spinlock (or similar lock 
construct)?  I know I could do something based on querying the state of the 
RCU/etc. locks but that seems like a hack and could interfere with some of the 
logic used to detect coding problems.

-- 
paul moore
linux @ hp

  reply	other threads:[~2010-03-29 20:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-25 11:06 [PATCH] NETLABEL: Fix an RCU warning David Howells
2010-03-25 11:28 ` Eric Dumazet
2010-03-25 11:37   ` David Howells
2010-03-25 13:32     ` Eric Dumazet
2010-03-25 14:10       ` Paul Moore
2010-03-29 15:24   ` Paul E. McKenney
2010-03-29 15:30     ` Paul Moore
2010-03-29 15:58       ` Paul E. McKenney
2010-03-29 20:05         ` Paul Moore [this message]
2010-03-29 20:19           ` Eric Dumazet

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=201003291605.48605.paul.moore@hp.com \
    --to=paul.moore@hp.com \
    --cc=dhowells@redhat.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).