Skip to content

Commit c53bf10

Browse files
jdamato-fslykuba-moo
authored andcommitted
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: [email protected] Fixes: 27f91aa ("netdev-genl: Add netlink framework functions for napi") Signed-off-by: Joe Damato <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ea301ae commit c53bf10

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
@@ -215,6 +215,7 @@ int netdev_nl_napi_get_doit(struct sk_buff *skb, struct genl_info *info)
215215
return -ENOMEM;
216216

217217
rtnl_lock();
218+
rcu_read_lock();
218219

219220
napi = napi_by_id(napi_id);
220221
if (napi) {
@@ -224,6 +225,7 @@ int netdev_nl_napi_get_doit(struct sk_buff *skb, struct genl_info *info)
224225
err = -ENOENT;
225226
}
226227

228+
rcu_read_unlock();
227229
rtnl_unlock();
228230

229231
if (err)

0 commit comments

Comments
 (0)