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: <1384457800.28716.30.camel@edumazet-glaptop2.roam.corp.google.com>
Date:	Thu, 14 Nov 2013 11:36:40 -0800
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Johannes Berg <johannes@...solutions.net>
Cc:	Dave Jones <davej@...hat.com>, David Miller <davem@...emloft.net>,
	netdev@...r.kernel.org, Yuchung Cheng <ycheng@...gle.com>
Subject: Re: [PATCH] net-tcp: fix panic in tcp_fastopen_cache_set()

On Thu, 2013-11-14 at 20:13 +0100, Johannes Berg wrote:
> On Wed, 2013-11-13 at 15:00 -0800, Eric Dumazet wrote:
> 
> > --- a/net/ipv4/tcp_metrics.c
> > +++ b/net/ipv4/tcp_metrics.c
> > @@ -663,10 +663,13 @@ void tcp_fastopen_cache_get(struct sock *sk, u16 *mss,
> >  void tcp_fastopen_cache_set(struct sock *sk, u16 mss,
> >  			    struct tcp_fastopen_cookie *cookie, bool syn_lost)
> >  {
> > +	struct dst_entry *dst = __sk_dst_get(sk);
> >  	struct tcp_metrics_block *tm;
> >  
> > +	if (!dst)
> > +		return;
> >  	rcu_read_lock();
> > -	tm = tcp_get_metrics(sk, __sk_dst_get(sk), true);
> 
> Doesn't that __sk_dst_get() have to go inside the rcu_read_lock()?
> 
> Then again, I guess we hold the socket. Still looks a bit weird to be
> moving it out.

Yep, in fact this rcu_read_lock() is not needed. I'll send a v2.

Thanks



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