]> 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>
Fri, 21 Feb 2025 12:50:06 +0000 (13:50 +0100)
commite2b01044d94ec895c065e0e48115e6ce01432152
treebb69beaa19ba2c1a7748404ac8e6d7b8025882ab
parent7bafb66f5456861021c1f756342a328c32ad6a4b
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: 71b8471c93fa ("ipv4: use RCU protection in ipv4_default_advmss()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/netdevice.h
include/net/net_namespace.h