]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipv4: icmp: convert to dev_net_rcu()
authorEric Dumazet <edumazet@google.com>
Wed, 5 Feb 2025 15:51:16 +0000 (15:51 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Feb 2025 13:01:42 +0000 (14:01 +0100)
commit3c925321a574362f6065dd97e6e764fc5985f0d5
tree7f4b0c71b863288df1ff754789136dd745c99814
parent4583748b65dee4d61bd50a2214715b4237bc152a
ipv4: icmp: convert to dev_net_rcu()

[ Upstream commit 4b8474a0951e605d2a27a2c483da4eb4b8c63760 ]

__icmp_send() must ensure rcu_read_lock() is held, as spotted
by Jakub.

Other ICMP uses of dev_net() seem safe, change them to dev_net_rcu()
to get LOCKDEP support.

Fixes: dde1bc0e6f86 ("[NETNS]: Add namespace for ICMP replying code.")
Closes: https://lore.kernel.org/netdev/20250203153633.46ce0337@kernel.org/
Reported-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250205155120.1676781-9-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/ipv4/icmp.c