lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 8 Feb 2013 11:19:32 -0800
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Cong Wang <xiyou.wangcong@...il.com>
Cc:	linux-kernel@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: net: rcu warnings in ip6fl_get_first

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@...cle.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@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ