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)
commit68bf74ec95c3046f51893a9c80e2d4ac526600de
tree4783bff60edee395ca36ac386ce6a785f71ae63c
parentc8b1baca99cf00dabe68220915ba3d327b6c2de5
inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()

[ Upstream commit 4915d50e300e96929d2462041d6f6c6f061167fd ]

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