netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Dave Jones <davej@redhat.com>, David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, Yuchung Cheng <ycheng@google.com>
Subject: Re: [PATCH] net-tcp: fix panic in tcp_fastopen_cache_set()
Date: Thu, 14 Nov 2013 20:13:38 +0100	[thread overview]
Message-ID: <1384456418.13941.40.camel@jlt4.sipsolutions.net> (raw)
In-Reply-To: <1384383646.28458.138.camel@edumazet-glaptop2.roam.corp.google.com>

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.

johannes

  parent reply	other threads:[~2013-11-14 19:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 20:45 oops in tcp_get_metrics, followed by lockup Dave Jones
2013-11-13 22:40 ` Eric Dumazet
2013-11-13 23:00   ` [PATCH] net-tcp: fix panic in tcp_fastopen_cache_set() Eric Dumazet
2013-11-13 23:08     ` Yuchung Cheng
2013-11-14 17:55     ` Dave Jones
2013-11-14 19:13     ` Johannes Berg [this message]
2013-11-14 19:36       ` Eric Dumazet
2013-11-14 19:38         ` Eric Dumazet
2013-11-14 20:53           ` Johannes Berg
2013-11-14 21:22             ` Eric Dumazet
2013-11-14 21:33     ` David Miller

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=1384456418.13941.40.camel@jlt4.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=ycheng@google.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).