]> www.infradead.org Git - users/dwmw2/linux.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>
Sun, 21 Aug 2022 13:15:50 +0000 (15:15 +0200)
commitf7884d95000a01624f6b4010d8eea36d39076f8b
tree48a63be9e7d0cf6d610423c7696bada2a7ea906a
parentc206177ca8a953d916c009eacb71ec4b81e58ecb
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