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: <CANn89iKNQw9x388P45BtbTiGFjj6PCC6vwDF7M9DJFUPhtNWJw@mail.gmail.com>
Date: Wed, 21 Aug 2024 14:38:58 +0200
From: Eric Dumazet <edumazet@...gle.com>
To: Jason Xing <kerneljasonxing@...il.com>
Cc: Paolo Abeni <pabeni@...hat.com>, davem@...emloft.net, kuba@...nel.org, 
	dsahern@...nel.org, ncardwell@...gle.com, kuniyu@...zon.com, 
	netdev@...r.kernel.org, Jason Xing <kernelxing@...cent.com>, 
	Jade Dong <jadedong@...cent.com>
Subject: Re: [PATCH v2 net-next] tcp: avoid reusing FIN_WAIT2 when trying to
 find port in connect() process

On Wed, Aug 21, 2024 at 12:03 PM Jason Xing <kerneljasonxing@...il.com> wrote:
>
> Hello Eric,
>
> On Tue, Aug 20, 2024 at 8:54 PM Jason Xing <kerneljasonxing@...il.com> wrote:
> >
> > Hello Eric,
> >
> > On Tue, Aug 20, 2024 at 8:39 PM Eric Dumazet <edumazet@...gle.com> wrote:
> > >
> > > On Tue, Aug 20, 2024 at 1:04 PM Paolo Abeni <pabeni@...hat.com> wrote:
> > > >
> > > > On 8/15/24 13:37, Jason Xing wrote:
> > > > > From: Jason Xing <kernelxing@...cent.com>
> > > > >
> > > > > We found that one close-wait socket was reset by the other side
> > > > > which is beyond our expectation,
> > > >
> > > > I'm unsure if you should instead reconsider your expectation: what if
> > > > the client application does:
> > > >
> > > > shutdown(fd, SHUT_WR)
> > > > close(fd); // with unread data
> > > >
> > >
> > > Also, I was hoping someone would mention IPv6 at some point.
> >
> > Thanks for reminding me. I'll dig into the IPv6 logic.
> >
> > >
> > > Jason, instead of a lengthy ChatGPT-style changelog, I would prefer a
> >
> > LOL, but sorry, I manually control the length which makes it look
> > strange, I'll adjust it.
> >
> > > packetdrill test exactly showing the issue.
> >
> > I will try the packetdrill.
> >
>
> Sorry that I'm not that good at writing such a case, I failed to add
> TS option which will be used in tcp_twsk_unique. So I think I need
> more time.

The following patch looks better to me, it covers the case where twp == NULL,
and is family independent.
It is also clear it will not impact DCCP without having to think about it.

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index fd17f25ff288a47fca3ec1881c87d56bd9989709..43a3362e746f331ac64b5e4e6de6878ecd27e115
100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -144,6 +144,8 @@ int tcp_twsk_unique(struct sock *sk, struct sock
*sktw, void *twp)
                        reuse = 0;
        }

+       if (tw->tw_substate == TCP_FIN_WAIT2)
+               reuse = 0;
        /* With PAWS, it is safe from the viewpoint
           of data integrity. Even without PAWS it is safe provided sequence
           spaces do not overlap i.e. at data rates <= 80Mbit/sec.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ