]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
soreuseport: fix merge conflict in tcp bind
authorCraig Gallek <kraig@google.com>
Mon, 22 Feb 2016 15:45:29 +0000 (10:45 -0500)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Feb 2016 18:38:18 +0000 (13:38 -0500)
One of the validation checks for the new array-based TCP SO_REUSEPORT
validation was unintentionally dropped in ea8add2b1903.  This adds it back.

Lack of this check allows the user to allocate multiple sock_reuseport
structures (leaking all but the first).

Fixes: ea8add2b1903 ("tcp/dccp: better use of ephemeral ports in bind()")
Signed-off-by: Craig Gallek <kraig@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/inet_connection_sock.c

index d7682306370ba78f041bf519ea7f14eca3a8b7c5..bc5196ea1bdfac8e4c8c918eaaf1d3af5f854968 100644 (file)
@@ -202,6 +202,7 @@ tb_found:
 
                if (((tb->fastreuse > 0 && reuse) ||
                     (tb->fastreuseport > 0 &&
+                     !rcu_access_pointer(sk->sk_reuseport_cb) &&
                      sk->sk_reuseport && uid_eq(tb->fastuid, uid))) &&
                    smallest_size == -1)
                        goto success;