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]
Date:   Mon, 27 Jun 2022 15:20:16 +0500
From:   Muhammad Usama Anjum <usama.anjum@...labora.com>
To:     Eric Dumazet <edumazet@...gle.com>
Cc:     usama.anjum@...labora.com, "David S. Miller" <davem@...emloft.net>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
        David Ahern <dsahern@...nel.org>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Gabriel Krisman Bertazi <krisman@...labora.com>,
        open list <linux-kernel@...r.kernel.org>,
        Collabora Kernel ML <kernel@...labora.com>,
        Paul Gofman <pgofman@...eweavers.com>,
        "open list:NETWORKING [TCP]" <netdev@...r.kernel.org>,
        Sami Farin <hvtaifwkbgefbaei@...il.com>
Subject: Re: [RFC] EADDRINUSE from bind() on application restart after killing

Hi Eric,

On 5/30/22 8:28 PM, Eric Dumazet wrote:
>> The following command and patch work for my use case. The socket in
>> TIME_WAIT_2 or TIME_WAIT state are closed when zapped.
>>
>> Can you please upstream this patch?
> Yes, I will when net-next reopens, thanks for testing it.
Have you tried upstreaming it?

Tested-by: Muhammad Usama Anjum <usama.anjum@...labora.com>

> 
>>> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
>>> index 9984d23a7f3e1353d2e1fc9053d98c77268c577e..1b7bde889096aa800b2994c64a3a68edf3b62434
>>> 100644
>>> --- a/net/ipv4/tcp.c
>>> +++ b/net/ipv4/tcp.c
>>> @@ -4519,6 +4519,15 @@ int tcp_abort(struct sock *sk, int err)
>>>                         local_bh_enable();
>>>                         return 0;
>>>                 }
>>> +               if (sk->sk_state == TCP_TIME_WAIT) {
>>> +                       struct inet_timewait_sock *tw = inet_twsk(sk);
>>> +
>>> +                       refcount_inc(&tw->tw_refcnt);
>>> +                       local_bh_disable();
>>> +                       inet_twsk_deschedule_put(tw);
>>> +                       local_bh_enable();
>>> +                       return 0;
>>> +               }
>>>                 return -EOPNOTSUPP;
>>>         }

-- 
Muhammad Usama Anjum

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ