Skip to content

Commit 1438f5d

Browse files
NicolasDichtelkuba-moo
authored andcommitted
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. CC: [email protected] Fixes: 636af13 ("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]>
1 parent bca0902 commit 1438f5d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/core/rtnetlink.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3432,6 +3432,7 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh,
34323432
err = -ENODEV;
34333433

34343434
rtnl_nets_unlock(&rtnl_nets);
3435+
rtnl_nets_destroy(&rtnl_nets);
34353436
errout:
34363437
return err;
34373438
}

0 commit comments

Comments
 (0)