lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221218232547.44526-1-kuniyu@amazon.com>
Date:   Mon, 19 Dec 2022 08:25:47 +0900
From:   Kuniyuki Iwashima <kuniyu@...zon.com>
To:     <jirislaby@...nel.org>
CC:     <davem@...emloft.net>, <joannelkoong@...il.com>, <kuba@...nel.org>,
        <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
        <pabeni@...hat.com>, <edumazet@...gle.com>, <kuniyu@...zon.com>
Subject: Re: [PULL] Networking for next-6.1

From:   Jiri Slaby <jirislaby@...nel.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ