]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 17 Oct 2022 09:56:28 +0000 (11:56 +0200)
commit287ef28174144064abcef76c49898e22b8685018
tree61c69c0edf686a863dbba1626d1bf7d31562d819
parent0088c60ec27c3db1131adfab8b5579d8b4e64e62
inet: add READ_ONCE(sk->sk_bound_dev_if) in INET_MATCH()

BugLink: https://bugs.launchpad.net/bugs/1990162
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
include/net/inet_hashtables.h
include/net/sock.h
net/ipv4/inet_hashtables.c
net/ipv4/udp.c