]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: add dev_net_rcu() helper
authorEric Dumazet <edumazet@google.com>
Wed, 5 Feb 2025 15:51:09 +0000 (15:51 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:42 +0000 (12:50 +0100)
commit6e0d214916862f4acb395281059265feb9b65883
treed7e375e7a228f6fc9e58021f3fbb8e6d355434a0
parentc22b8d77816e8f67536190599f46f2f6195f5c36
net: add dev_net_rcu() helper

[ Upstream commit 482ad2a4ace2740ca0ff1cbc8f3c7f862f3ab507 ]

dev->nd_net can change, readers should either
use rcu_read_lock() or RTNL.

We currently use a generic helper, dev_net() with
no debugging support. We probably have many hidden bugs.

Add dev_net_rcu() helper for callers using rcu_read_lock()
protection.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250205155120.1676781-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Stable-dep-of: dd205fcc33d9 ("ipv4: use RCU protection in rt_is_expired()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/netdevice.h
include/net/net_namespace.h