netdev-genl: Hold rcu_read_lock in napi_get
commit c53bf100f68619acf6cedcf4cf5249a1ca2db0b4 upstream.
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: 27f91aaf49 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b6a1ba1915
commit
343e3e903c
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user