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:   Thu, 13 Jun 2019 21:28:21 -0700
From:   Eric Dumazet <eric.dumazet@...il.com>
To:     maowenan <maowenan@...wei.com>, Eric Dumazet <edumazet@...gle.com>
Cc:     David Miller <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH net v2] tcp: avoid creating multiple req socks with the
 same tuples



On 6/13/19 9:19 PM, maowenan wrote:
> 
> 
> @Eric, for this issue I only want to check TCP_NEW_SYN_RECV sk, is it OK like below?
>  +       if (!osk && sk->sk_state == TCP_NEW_SYN_RECV)
>  +               reqsk = __inet_lookup_established(sock_net(sk), &tcp_hashinfo,
>  +                                                       sk->sk_daddr, sk->sk_dport,
>  +                                                       sk->sk_rcv_saddr, sk->sk_num,
>  +                                                       sk->sk_bound_dev_if, sk->sk_bound_dev_if);
>  +       if (unlikely(reqsk)) {
> 

Not enough.

If we have many cpus here, there is a chance another cpu has inserted a request socket, then
replaced it by an ESTABLISH socket for the same 4-tuple.

We need to take the per bucket spinlock much sooner.

And this is fine, all what matters is that we do no longer grab the listener spinlock.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ