Skip to content

Commit c414205

Browse files
committed
netdev-genl: Hold rcu_read_lock in napi_set
JIRA: https://issues.redhat.com/browse/RHEL-77816 Upstream Status: net.git commit ed7231f commit ed7231f Author: Joe Damato <jdamato@fastly.com> Date: Thu Nov 14 17:55:59 2024 +0000 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: 1287c1a ("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> Signed-off-by: Davide Caratti <dcaratti@redhat.com>
1 parent 7d82d0e commit c414205

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/core/netdev-genl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ int netdev_nl_napi_set_doit(struct sk_buff *skb, struct genl_info *info)
335335
napi_id = nla_get_u32(info->attrs[NETDEV_A_NAPI_ID]);
336336

337337
rtnl_lock();
338+
rcu_read_lock();
338339

339340
napi = napi_by_id(napi_id);
340341
if (napi) {
@@ -344,6 +345,7 @@ int netdev_nl_napi_set_doit(struct sk_buff *skb, struct genl_info *info)
344345
err = -ENOENT;
345346
}
346347

348+
rcu_read_unlock();
347349
rtnl_unlock();
348350

349351
return err;

0 commit comments

Comments
 (0)