netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: net: rcu warnings in ip6fl_get_first
Date: Fri, 8 Feb 2013 11:19:32 -0800	[thread overview]
Message-ID: <20130208191932.GG2666@linux.vnet.ibm.com> (raw)
In-Reply-To: <kf1kul$699$2@ger.gmane.org>

On Fri, Feb 08, 2013 at 01:38:29AM +0000, Cong Wang wrote:
> On Thu, 07 Feb 2013 at 19:32 GMT, Sasha Levin <sasha.levin@oracle.com> wrote:
> > Hi guys,
> >
> > I got the following while fuzzing with trinity inside a KVM tools guest:
> >
> > [   51.680236] ===============================
> > [   51.681914] [ INFO: suspicious RCU usage. ]
> > [   51.683610] 3.8.0-rc6-next-20130206-sasha-00028-g83214f7-dirty #276 Tainted: G        W
> > [   51.686703] -------------------------------
> > [   51.688281] net/ipv6/ip6_flowlabel.c:671 suspicious rcu_dereference_check() usage!
> > [   51.691345]
> 
> It should use rcu_dereference_bh()...
> 
> diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
> index ea42bf4..c50080f 100644
> --- a/net/ipv6/ip6_flowlabel.c
> +++ b/net/ipv6/ip6_flowlabel.c
> @@ -65,13 +65,13 @@ static DEFINE_SPINLOCK(ip6_fl_lock);
>  static DEFINE_SPINLOCK(ip6_sk_fl_lock);
> 
>  #define for_each_fl_rcu(hash, fl)				\
> -	for (fl = rcu_dereference(fl_ht[(hash)]);		\
> +	for (fl = rcu_dereference_bh(fl_ht[(hash)]);		\
>  	     fl != NULL;					\
> -	     fl = rcu_dereference(fl->next))
> +	     fl = rcu_dereference_hb(fl->next))

Small but important typo in the preceding line, should be:

 +	     fl = rcu_dereference_bh(fl->next))

 							Thanx, Paul

>  #define for_each_fl_continue_rcu(fl)				\
> -	for (fl = rcu_dereference(fl->next);			\
> +	for (fl = rcu_dereference_bh(fl->next);			\
>  	     fl != NULL;					\
> -	     fl = rcu_dereference(fl->next))
> +	     fl = rcu_dereference_bh(fl->next))
> 
>  #define for_each_sk_fl_rcu(np, sfl)				\
>  	for (sfl = rcu_dereference_bh(np->ipv6_fl_list);	\
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

      parent reply	other threads:[~2013-02-08 19:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 19:32 net: rcu warnings in ip6fl_get_first Sasha Levin
2013-02-08  1:37 ` Cong Wang
2013-02-08  1:38 ` Cong Wang
2013-02-08  3:54   ` Sasha Levin
2013-02-08 19:19   ` 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=20130208191932.GG2666@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@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;
as well as URLs for NNTP newsgroup(s).