提交 e5fbfc1c 编写于 作者: C Craig Gallek 提交者: David S. Miller

soreuseport: fix merge conflict in tcp bind

One of the validation checks for the new array-based TCP SO_REUSEPORT
validation was unintentionally dropped in ea8add2b.  This adds it back.

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

Fixes: ea8add2b ("tcp/dccp: better use of ephemeral ports in bind()")
Signed-off-by: NCraig Gallek <kraig@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f5461c27
...@@ -202,6 +202,7 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum) ...@@ -202,6 +202,7 @@ int inet_csk_get_port(struct sock *sk, unsigned short snum)
if (((tb->fastreuse > 0 && reuse) || if (((tb->fastreuse > 0 && reuse) ||
(tb->fastreuseport > 0 && (tb->fastreuseport > 0 &&
!rcu_access_pointer(sk->sk_reuseport_cb) &&
sk->sk_reuseport && uid_eq(tb->fastuid, uid))) && sk->sk_reuseport && uid_eq(tb->fastuid, uid))) &&
smallest_size == -1) smallest_size == -1)
goto success; goto success;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册