This is a note to let you know that I've just added the patch titled netdev-genl: avoid empty messages in napi get to the 6.12-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: netdev-genl-avoid-empty-messages-in-napi-get.patch and it can be found in the queue-6.12 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit b15d870b78b8ba0c172fce91caae4ddca7db5905 Author: Jakub Kicinski <kuba@xxxxxxxxxx> Date: Wed Dec 18 19:28:32 2024 -0800 netdev-genl: avoid empty messages in napi get [ Upstream commit 4a25201aa46ce88e8e31f9ccdec0e4e3dd6bb736 ] Empty netlink responses from do() are not correct (as opposed to dump() where not dumping anything is perfectly fine). We should return an error if the target object does not exist, in this case if the netdev is down we "hide" the NAPI instances. Fixes: 27f91aaf49b3 ("netdev-genl: Add netlink framework functions for napi") Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx> Link: https://patch.msgid.link/20241219032833.1165433-1-kuba@xxxxxxxxxx Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c index 7ce22f40db5b..d58270b48cb2 100644 --- a/net/core/netdev-genl.c +++ b/net/core/netdev-genl.c @@ -228,8 +228,12 @@ int netdev_nl_napi_get_doit(struct sk_buff *skb, struct genl_info *info) rcu_read_unlock(); rtnl_unlock(); - if (err) + if (err) { + goto err_free_msg; + } else if (!rsp->len) { + err = -ENOENT; goto err_free_msg; + } return genlmsg_reply(rsp, info);