rtnetlink: fix netns leak with rtnl_setlink()
Subsystems (3)
PATCH 1/1 rtnetlink: fix netns leak with rtnl_setlink()
A call to rtnl_nets_destroy() is needed to release references taken on netns put in rtnl_nets.
Fixes 636af13f213b ("rtnetlink: Register rtnl_dellink() and rtnl_setlink() with RTNL_FLAG_DOIT_PERNET_WIP.")
Signed-off-by Nicolas Dichtel <[email protected]>
--- net/core/rtnetlink.c | 1 + 1 file changed, 1 insertion(+)
net/core/rtnetlink.c +1 -0
@@ -3432,6 +3432,7 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, err = -ENODEV ;rtnl_nets_unlock (&rtnl_nets); +rtnl_nets_destroy (&rtnl_nets); errout:return err; }
Signature · 1 line
2.47.1
From: Nicolas Dichtel <[email protected]>
Date: Wed, 5 Feb 2025 23:10:37 +0100
Quoted 6 lines
A call to
rtnl_nets_destroy()is needed to release references taken on netns put inrtnl_nets.Fixes 636af13f213b ("rtnetlink: Register rtnl_dellink() and rtnl_setlink() with RTNL_FLAG_DOIT_PERNET_WIP.")Signed-off-by Nicolas Dichtel <[email protected]>
Reviewed-by Kuniyuki Iwashima <[email protected]>
Thanks!
Quoted 19 lines
--- net/core/rtnetlink.c | 1 + 1 file changed, 1 insertion(+)net/core/rtnetlink.c +1
-0@@ -3432,6 +3432,7 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, err = -ENODEV ;rtnl_nets_unlock (&rtnl_nets); +rtnl_nets_destroy (&rtnl_nets); errout:return err; }Signature · 1 line
2.47.1
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Wed, 5 Feb 2025 23:10:37 +0100 you wrote:
A call to
rtnl_nets_destroy()is needed to release references taken on netns put inrtnl_nets.Fixes 636af13f213b ("rtnetlink: Register rtnl_dellink() and rtnl_setlink() with RTNL_FLAG_DOIT_PERNET_WIP.")Signed-off-by Nicolas Dichtel <[email protected]>[...]
Here is the summary with links:
- [net] rtnetlink: fix netns leak with rtnl_setlink()
https://git.kernel.org/netdev/net/c/1438f5d07b9a
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html