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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1272385984.2295.318.camel@edumazet-laptop>
Date:	Tue, 27 Apr 2010 18:33:04 +0200
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	paulmck@...ux.vnet.ibm.com
Cc:	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Miles Lane <miles.lane@...il.com>,
	Vivek Goyal <vgoyal@...hat.com>,
	Eric Paris <eparis@...hat.com>,
	Lai Jiangshan <laijs@...fujitsu.com>,
	Ingo Molnar <mingo@...e.hu>,
	Peter Zijlstra <peterz@...radead.org>,
	LKML <linux-kernel@...r.kernel.org>, nauman@...gle.com,
	netdev@...r.kernel.org, Jens Axboe <jens.axboe@...cle.com>,
	Gui Jianfeng <guijianfeng@...fujitsu.com>,
	Li Zefan <lizf@...fujitsu.com>,
	Johannes Berg <johannes@...solutions.net>
Subject: Re: [PATCH] RCU: don't turn off lockdep when find suspicious
 rcu_dereference_check() usage

Le mardi 27 avril 2010 à 09:22 -0700, Paul E. McKenney a écrit :
> On Mon, Apr 26, 2010 at 09:27:44PM -0700, Paul E. McKenney wrote:
> > On Mon, Apr 26, 2010 at 11:35:10AM -0700, Eric W. Biederman wrote:
> > > "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com> writes:
> > > 
> > > > Eric Dumazet traced these down to a commit from Eric Biederman.
> > > >
> > > > If I don't hear from Eric Biederman in a few days, I will attempt a
> > > > patch, but it would be more likely to be correct coming from someone
> > > > with a better understanding of the code.  ;-)
> > > 
> > > I already replied.
> > > 
> > > http://lkml.org/lkml/2010/4/21/420
> > 
> > You did indeed!!!  This experience is giving me an even better appreciation
> > of the maintainers' ability to keep all their patches straight!
> > 
> > I will put together something based on your suggestion.
> 
> How about the following?
> 
> 							Thanx, Paul
> 
> ------------------------------------------------------------------------
> 
> commit 85fa42bd568ab99c375f018761ae6345249942cd
> Author: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> Date:   Mon Apr 26 21:40:05 2010 -0700
> 
>     net: suppress RCU lockdep false positive in twsk_net()
>     
>     Calls to twsk_net() are in some cases protected by reference counting
>     as an alternative to RCU protection.  Cases covered by reference counts
>     include __inet_twsk_kill(), inet_twsk_free(), inet_twdr_do_twkill_work(),
>     inet_twdr_twcal_tick(), and tcp_timewait_state_process().  RCU is used
>     by inet_twsk_purge().  Locking is used by established_get_first()
>     and established_get_next().  Finally, __inet_twsk_hashdance() is an
>     initialization case.
>     
>     It appears to be non-trivial to locate the appropriate locks and
>     reference counts from within twsk_net(), so used rcu_dereference_raw().
>     
>     Signed-off-by: Paul E. McKenney <paulmck@...ux.vnet.ibm.com>
> 
> diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
> index 79f67ea..a066fdd 100644
> --- a/include/net/inet_timewait_sock.h
> +++ b/include/net/inet_timewait_sock.h
> @@ -224,7 +224,9 @@ static inline
>  struct net *twsk_net(const struct inet_timewait_sock *twsk)
>  {
>  #ifdef CONFIG_NET_NS
> -	return rcu_dereference(twsk->tw_net);
> +	return rcu_dereference_raw(twsk->tw_net); /* protected by locking, */
> +						  /* reference counting, */
> +						  /* initialization, or RCU. */
>  #else
>  	return &init_net;
>  #endif
> --

Acked-by: Eric Dumazet <eric.dumazet@...il.com>


--
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