diff options
author | Joe Damato <jdamato@fastly.com> | 2024-11-14 18:51:56 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2024-11-15 23:20:19 +0100 |
commit | c53bf100f68619acf6cedcf4cf5249a1ca2db0b4 (patch) | |
tree | 4701f36f41973db58362fbc2c9bbe2b1bef10d13 /net/core | |
parent | i40e: Fix handling changed priv flags (diff) | |
download | linux-c53bf100f68619acf6cedcf4cf5249a1ca2db0b4.tar.xz linux-c53bf100f68619acf6cedcf4cf5249a1ca2db0b4.zip |
netdev-genl: Hold rcu_read_lock in napi_get
Hold rcu_read_lock in netdev_nl_napi_get_doit, which calls napi_by_id
and is required to be called under rcu_read_lock.
Cc: stable@vger.kernel.org
Fixes: 27f91aaf49b3 ("netdev-genl: Add netlink framework functions for napi")
Signed-off-by: Joe Damato <jdamato@fastly.com>
Link: https://patch.msgid.link/20241114175157.16604-1-jdamato@fastly.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/netdev-genl.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c index 1cb954f2d39e..d2baa1af9df0 100644 --- a/net/core/netdev-genl.c +++ b/net/core/netdev-genl.c @@ -215,6 +215,7 @@ int netdev_nl_napi_get_doit(struct sk_buff *skb, struct genl_info *info) return -ENOMEM; rtnl_lock(); + rcu_read_lock(); napi = napi_by_id(napi_id); if (napi) { @@ -224,6 +225,7 @@ int netdev_nl_napi_get_doit(struct sk_buff *skb, struct genl_info *info) err = -ENOENT; } + rcu_read_unlock(); rtnl_unlock(); if (err) |