All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin KaFai Lau <martin.lau@linux.dev>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: Kuniyuki Iwashima <kuni1840@gmail.com>,
	netdev@vger.kernel.org, Paul Holzinger <pholzing@redhat.com>,
	Martin KaFai Lau <martin.lau@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	David Ahern <dsahern@kernel.org>
Subject: Re: [PATCH v1 net 1/2] tcp: Fix bind() conflict check for dual-stack wildcard address.
Date: Tue, 14 Mar 2023 11:34:01 -0700	[thread overview]
Message-ID: <a8c21051-b6e0-a9f6-2530-5b36cb27d613@linux.dev> (raw)
In-Reply-To: <20230312031904.4674-2-kuniyu@amazon.com>

On 3/11/23 7:19 PM, Kuniyuki Iwashima wrote:
> Paul Holzinger reported [0] that commit 5456262d2baa ("net: Fix
> incorrect address comparison when searching for a bind2 bucket")
> introduced a bind() regression.  Paul also gave a nice repro that
> calls two types of bind() on the same port, both of which now
> succeed, but the second call should fail:
> 
>    bind(fd1, ::, port) + bind(fd2, 127.0.0.1, port)
> 
> The cited commit added address family tests in three functions to
> fix the uninit-value KMSAN report. [1]  However, the test added to
> inet_bind2_bucket_match_addr_any() removed a necessary conflict
> check; the dual-stack wildcard address no longer conflicts with
> an IPv4 non-wildcard address.
> 
> If tb->family is AF_INET6 and sk->sk_family is AF_INET in
> inet_bind2_bucket_match_addr_any(), we still need to check
> if tb has the dual-stack wildcard address.
> 
> Note that the IPv4 wildcard address does not conflict with
> IPv6 non-wildcard addresses.
> 
> [0]: https://lore.kernel.org/netdev/e21bf153-80b0-9ec0-15ba-e04a4ad42c34@redhat.com/
> [1]: https://lore.kernel.org/netdev/CAG_fn=Ud3zSW7AZWXc+asfMhZVL5ETnvuY44Pmyv4NPv-ijN-A@mail.gmail.com/
> 
> Fixes: 5456262d2baa ("net: Fix incorrect address comparison when searching for a bind2 bucket")
> Reported-by: Paul Holzinger <pholzing@redhat.com>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>

Thanks for the fix.

Reviewed-by: Martin KaFai Lau <martin.lau@kernel.org>


  parent reply	other threads:[~2023-03-14 18:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12  3:19 [PATCH v1 net 0/2] tcp: Fix bind() regression for dual-stack wildcard address Kuniyuki Iwashima
2023-03-12  3:19 ` [PATCH v1 net 1/2] tcp: Fix bind() conflict check " Kuniyuki Iwashima
2023-03-12 11:42   ` Linux regression tracking (Thorsten Leemhuis)
2023-03-15  7:26     ` Jakub Kicinski
2023-03-15  8:05       ` Thorsten Leemhuis
2023-03-15 19:52         ` Jakub Kicinski
2023-03-13 12:39   ` Eric Dumazet
2023-03-13 16:12   ` Paul Holzinger
2023-03-14 18:34   ` Martin KaFai Lau [this message]
2023-03-12  3:19 ` [PATCH v1 net 2/2] selftest: Add test for bind() conflicts Kuniyuki Iwashima
2023-03-15  7:30 ` [PATCH v1 net 0/2] tcp: Fix bind() regression for dual-stack wildcard address patchwork-bot+netdevbpf

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=a8c21051-b6e0-a9f6-2530-5b36cb27d613@linux.dev \
    --to=martin.lau@linux.dev \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@amazon.com \
    --cc=martin.lau@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pholzing@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.