diff options
author | 2024-11-14 17:55:59 +0000 | |
---|---|---|
committer | 2024-11-15 14:21:00 -0800 | |
commit | ed7231f56cd7f795ff3a831e32946a96661bfee9 (patch) | |
tree | 6957ea888ed35ec7ede3e4f716633c74966860ab /net/core/netdev-genl.c | |
parent | Merge tag 'for-net-next-2024-11-14' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next (diff) | |
download | wireguard-linux-ed7231f56cd7f795ff3a831e32946a96661bfee9.tar.xz wireguard-linux-ed7231f56cd7f795ff3a831e32946a96661bfee9.zip |
netdev-genl: Hold rcu_read_lock in napi_set
Hold rcu_read_lock during netdev_nl_napi_set_doit, which calls
napi_by_id and requires rcu_read_lock to be held.
Closes: https://lore.kernel.org/netdev/719083c2-e277-447b-b6ea-ca3acb293a03@redhat.com/
Fixes: 1287c1ae0fc2 ("netdev-genl: Support setting per-NAPI config values")
Signed-off-by: Joe Damato <jdamato@fastly.com>
Link: https://patch.msgid.link/20241114175600.18882-1-jdamato@fastly.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/core/netdev-genl.c')
-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 765ce7c9d73b..fa119ff68698 100644 --- a/net/core/netdev-genl.c +++ b/net/core/netdev-genl.c @@ -346,6 +346,7 @@ int netdev_nl_napi_set_doit(struct sk_buff *skb, struct genl_info *info) napi_id = nla_get_u32(info->attrs[NETDEV_A_NAPI_ID]); rtnl_lock(); + rcu_read_lock(); napi = napi_by_id(napi_id); if (napi) { @@ -355,6 +356,7 @@ int netdev_nl_napi_set_doit(struct sk_buff *skb, struct genl_info *info) err = -ENOENT; } + rcu_read_unlock(); rtnl_unlock(); return err; |