]> git.baikalelectronics.ru Git - kernel.git/commit
inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()
authorEric Dumazet <edumazet@google.com>
Thu, 12 May 2022 16:56:01 +0000 (09:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:35 +0000 (14:23 +0200)
commit35e2dc08e7ee2b454492e5c53a3b0b118a9d1ed4
tree4783bff60edee395ca36ac386ce6a785f71ae63c
parent27e25b7cd675f384fc356eb7e43bc43a54698387
inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()

[ Upstream commit 9783869a6f8011f07141f790b4fd42a474c06e94 ]

INET_MATCH() runs without holding a lock on the socket.

We probably need to annotate most reads.

This patch makes INET_MATCH() an inline function
to ease our changes.

v2:

We remove the 32bit version of it, as modern compilers
should generate the same code really, no need to
try to be smarter.

Also make 'struct net *net' the first argument.

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>
include/net/inet_hashtables.h
include/net/sock.h
net/ipv4/inet_hashtables.c
net/ipv4/udp.c