mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Michal Kubecek <mkubecek@suse.cz>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Eric Dumazet <edumazet@google.com>,
	Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
	James Morris <jmorris@namei.org>,
	Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
	Patrick McHardy <kaber@trash.net>
Subject: Re: [PATCH net v2] tcp: prevent fetching dst twice in early demux code
Date: Mon, 23 Mar 2015 07:39:24 -0700	[thread overview]
Message-ID: <1427121564.25985.69.camel@edumazet-glaptop2.roam.corp.google.com> (raw)
In-Reply-To: <20150323141400.1568AA0CCC@unicorn.suse.cz>

On Mon, 2015-03-23 at 15:14 +0100, Michal Kubecek wrote:
> On s390x, gcc 4.8 compiles this part of tcp_v6_early_demux()
> 
>         struct dst_entry *dst = sk->sk_rx_dst;
> 
>         if (dst)
>                 dst = dst_check(dst, inet6_sk(sk)->rx_dst_cookie);
> 
> to code reading sk->sk_rx_dst twice, once for the test and once for
> the argument of ip6_dst_check() (dst_check() is inline). This allows
> ip6_dst_check() to be called with null first argument, causing a crash.
> 
> Protect sk->sk_rx_dst access by READ_ONCE() both in IPv4 and IPv6
> TCP early demux code.
> 
> Fixes: 41063e9dd119 ("ipv4: Early TCP socket demux.")
> Fixes: c7109986db3c ("ipv6: Early TCP socket demux")
> Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
> ---

Acked-by: Eric Dumazet <edumazet@google.com>

Thanks Michal



  reply	other threads:[~2015-03-23 14:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23  8:27 [PATCH net] " Michal Kubecek
2015-03-23 13:49 ` Eric Dumazet
2015-03-23 14:12   ` Michal Kubecek
2015-03-23 14:14   ` [PATCH net v2] " Michal Kubecek
2015-03-23 14:39     ` Eric Dumazet [this message]
2015-03-24  2:39     ` 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=1427121564.25985.69.camel@edumazet-glaptop2.roam.corp.google.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jmorris@namei.org \
    --cc=kaber@trash.net \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkubecek@suse.cz \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /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

all inboxes | Powered by JetHome®