linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Craig Gallek <kraigatgoog@gmail.com>
To: Kamal Mostafa <kamal@canonical.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	stable@vger.kernel.org, kernel-team@lists.ubuntu.com,
	Eric Dumazet <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH 4.2.y-ckt 52/53] soreuseport: fix ordering for mixed v4/v6 sockets
Date: Tue, 24 May 2016 14:30:01 -0400	[thread overview]
Message-ID: <CAEfhGiwmzxgPYYMY=2rAR1k7jpezUU0-svj0_d4b4=HLMbr4Zw@mail.gmail.com> (raw)

On Tue, May 24, 2016 at 1:55 PM, Kamal Mostafa <kamal@canonical.com> wrote:
> 4.2.8-ckt11 -stable review patch.  If anyone has any objections, please let me know.
I don't believe the bug that this patch fixes was present in the 4.2
kernel.  That issue first appeared in 4.5 and was resolved during the
4.6 release candidate iterations.

Thanks,
Craig

> ---8<------------------------------------------------------------
>
> From: Craig Gallek <kraig@google.com>
>
> [ Upstream commit d894ba18d4e449b3a7f6eb491f16c9e02933736e ]
>
> With the SO_REUSEPORT socket option, it is possible to create sockets
> in the AF_INET and AF_INET6 domains which are bound to the same IPv4 address.
> This is only possible with SO_REUSEPORT and when not using IPV6_V6ONLY on
> the AF_INET6 sockets.
>
> Prior to the commits referenced below, an incoming IPv4 packet would
> always be routed to a socket of type AF_INET when this mixed-mode was used.
> After those changes, the same packet would be routed to the most recently
> bound socket (if this happened to be an AF_INET6 socket, it would
> have an IPv4 mapped IPv6 address).
>
> The change in behavior occurred because the recent SO_REUSEPORT optimizations
> short-circuit the socket scoring logic as soon as they find a match.  They
> did not take into account the scoring logic that favors AF_INET sockets
> over AF_INET6 sockets in the event of a tie.
>
> To fix this problem, this patch changes the insertion order of AF_INET
> and AF_INET6 addresses in the TCP and UDP socket lists when the sockets
> have SO_REUSEPORT set.  AF_INET sockets will be inserted at the head of the
> list and AF_INET6 sockets with SO_REUSEPORT set will always be inserted at
> the tail of the list.  This will force AF_INET sockets to always be
> considered first.
>
> Fixes: e32ea7e74727 ("soreuseport: fast reuseport UDP socket selection")
> Fixes: 125e80b88687 ("soreuseport: fast reuseport TCP socket selection")
>
> Reported-by: Maciej Żenczykowski <maze@google.com>
> Signed-off-by: Craig Gallek <kraig@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>
> Signed-off-by: Kamal Mostafa <kamal@canonical.com>
> ---

             reply	other threads:[~2016-05-24 18:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-24 18:30 Craig Gallek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-05-24 17:54 [4.2.y-ckt stable] Linux 4.2.8-ckt11 stable review Kamal Mostafa
2016-05-24 17:55 ` [PATCH 4.2.y-ckt 52/53] soreuseport: fix ordering for mixed v4/v6 sockets Kamal Mostafa

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='CAEfhGiwmzxgPYYMY=2rAR1k7jpezUU0-svj0_d4b4=HLMbr4Zw@mail.gmail.com' \
    --to=kraigatgoog@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kamal@canonical.com \
    --cc=kernel-team@lists.ubuntu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).