You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
inet: add READ_ONCE(sk->sk_bound_dev_if) in inet_csk_bind_conflict()
[ Upstream commit d2c135619c ]
inet_csk_bind_conflict() can access sk->sk_bound_dev_if for
unlocked sockets.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
49aa080951
commit
9920e87a84
@@ -147,10 +147,14 @@ static int inet_csk_bind_conflict(const struct sock *sk,
|
||||
*/
|
||||
|
||||
sk_for_each_bound(sk2, &tb->owners) {
|
||||
if (sk != sk2 &&
|
||||
(!sk->sk_bound_dev_if ||
|
||||
!sk2->sk_bound_dev_if ||
|
||||
sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
|
||||
int bound_dev_if2;
|
||||
|
||||
if (sk == sk2)
|
||||
continue;
|
||||
bound_dev_if2 = READ_ONCE(sk2->sk_bound_dev_if);
|
||||
if ((!sk->sk_bound_dev_if ||
|
||||
!bound_dev_if2 ||
|
||||
sk->sk_bound_dev_if == bound_dev_if2)) {
|
||||
if (reuse && sk2->sk_reuse &&
|
||||
sk2->sk_state != TCP_LISTEN) {
|
||||
if ((!relax ||
|
||||
|
||||
Reference in New Issue
Block a user