]> Git Repo - linux.git/commitdiff
rtnetlink: fix netns leak with rtnl_setlink()
authorNicolas Dichtel <[email protected]>
Wed, 5 Feb 2025 22:10:37 +0000 (23:10 +0100)
committerJakub Kicinski <[email protected]>
Fri, 7 Feb 2025 01:17:44 +0000 (17:17 -0800)
A call to rtnl_nets_destroy() is needed to release references taken on
netns put in rtnl_nets.

CC: [email protected]
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]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
net/core/rtnetlink.c

index 1f4d4b5570ab896593a6b3216678b90c7b0696de..d1e559fce918d3f1c32ac5313812df11be09ecc3 100644 (file)
@@ -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;
 }
This page took 0.067352 seconds and 4 git commands to generate.