Skip to content

Commit

Permalink
soreuseport: fix merge conflict in tcp bind
Browse files Browse the repository at this point in the history
One of the validation checks for the new array-based TCP SO_REUSEPORT
validation was unintentionally dropped in ea8add2.  This adds it back.

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

Fixes: ea8add2 ("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>
  • Loading branch information
Craig Gallek authored and David S. Miller committed Feb 24, 2016
1 parent f5461c2 commit e5fbfc1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/ipv4/inet_connection_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum)

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;
Expand Down

0 comments on commit e5fbfc1

Please sign in to comment.