All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <jirislaby@kernel.org>
Cc: <davem@davemloft.net>, <joannelkoong@gmail.com>,
	<kuba@kernel.org>, <linux-kernel@vger.kernel.org>,
	<netdev@vger.kernel.org>, <pabeni@redhat.com>,
	<edumazet@google.com>, <kuniyu@amazon.com>
Subject: Re: [PULL] Networking for next-6.1
Date: Mon, 19 Dec 2022 08:25:47 +0900	[thread overview]
Message-ID: <20221218232547.44526-1-kuniyu@amazon.com> (raw)
In-Reply-To: <6b971a4e-c7d8-411e-1f92-fda29b5b2fb9@kernel.org>

From:   Jiri Slaby <jirislaby@kernel.org>
Date:   Fri, 16 Dec 2022 11:49:01 +0100
> Hi,
> 
> On 04. 10. 22, 7:20, Jakub Kicinski wrote:
> > Joanne Koong (7):
> 
> >        net: Add a bhash2 table hashed by port and address
> 
> This makes regression tests of python-ephemeral-port-reserve to fail.
> 
> I'm not sure if the issue is in the commit or in the test.

Hi Jiri,

Thanks for reporting the issue.

It seems we forgot to add TIME_WAIT sockets into bhash2 in
inet_twsk_hashdance(), therefore inet_bhash2_conflict() misses
TIME_WAIT sockets when validating bind() requests if the address
is not a wildcard one.

I'll fix it.

Thank you.

> 
> This C reproducer used to fail with 6.0, now it succeeds:
> #include <err.h>
> #include <errno.h>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <unistd.h>
> 
> #include <sys/socket.h>
> 
> #include <arpa/inet.h>
> #include <netinet/ip.h>
> 
> int main()
> {
>          int x;
>          int s1 = socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_IP);
>          if (s1 < 0)
>                  err(1, "sock1");
>          x = 1;
>          if (setsockopt(s1, SOL_SOCKET, SO_REUSEADDR, &x, sizeof(x)))
>                  err(1, "setsockopt1");
> 
>          struct sockaddr_in in = {
>                  .sin_family = AF_INET,
>                  .sin_port = INADDR_ANY,
>                  .sin_addr = { htonl(INADDR_LOOPBACK) },
>          };
>          if (bind(s1, (const struct sockaddr *)&in, sizeof(in)) < 0)
>                  err(1, "bind1");
> 
>          if (listen(s1, 1) < 0)
>                  err(1, "listen1");
> 
>          socklen_t inl = sizeof(in);
>          if (getsockname(s1, (struct sockaddr *)&in, &inl) < 0)
>                  err(1, "getsockname1");
> 
>          int s2 = socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_IP);
>          if (s1 < 0)
>                  err(1, "sock2");
> 
>          if (connect(s2, (struct sockaddr *)&in, inl) < 0)
>                  err(1, "conn2");
> 
>          struct sockaddr_in acc;
>          inl = sizeof(acc);
>          int fdX = accept(s1, (struct sockaddr *)&acc, &inl);
>          if (fdX < 0)
>                  err(1, "accept");
> 
>          close(fdX);
>          close(s2);
>          close(s1);
> 
>          int s3 = socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC, IPPROTO_IP);
>          if (s3 < 0)
>                  err(1, "sock3");
> 
>          if (bind(s3, (struct sockaddr *)&in, sizeof(in)) < 0)
>                  err(1, "bind3");
> 
>          close(s3);
> 
>          return 0;
> }
> 
> 
> 
> thanks,
> -- 
> js
> suse labs

  reply	other threads:[~2022-12-18 23:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-04  5:20 [PULL] Networking for next-6.1 Jakub Kicinski
2022-10-04 21:40 ` pr-tracker-bot
2022-12-16 10:49 ` Jiri Slaby
2022-12-18 23:25   ` Kuniyuki Iwashima [this message]
2022-12-20  6:22     ` Jiri Slaby
2022-12-20  6:28       ` Kuniyuki Iwashima
2022-12-21 11:30   ` [PULL] Networking for next-6.1 #forregzbot Thorsten Leemhuis
2022-12-22 12:20     ` Thorsten Leemhuis
2023-01-30 15:19       ` Linux kernel regression tracking (#update)

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=20221218232547.44526-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jirislaby@kernel.org \
    --cc=joannelkoong@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@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.