[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1384457922.28716.32.camel@edumazet-glaptop2.roam.corp.google.com>
Date: Thu, 14 Nov 2013 11:38:42 -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 11:36 -0800, Eric Dumazet wrote:
> 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.
I take it back.
the rcu_read_lock() protects the tcp_get_metrics(), not the
__sk_dst_get(sk)
So the patch is correct, unless you disagree of course ;)
--
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