Re: [PATCH net 2/2] rtnetlink: Release nets when leaving rtnl_setlink()

From: Bastien Curutchet
Date: Wed Feb 12 2025 - 04:05:36 EST


On 2/12/25 9:31 AM, Kuniyuki Iwashima wrote:
From: "Bastien Curutchet (eBPF Foundation)" <bastien.curutchet@xxxxxxxxxxx>
Date: Wed, 12 Feb 2025 09:23:48 +0100
rtnl_setlink() uses the rtnl_nets_* helpers but never calls the
rtnl_nets_destroy(). It leads to small memory leaks.

Call rtnl_nets_destroy() before exiting to properly decrement the nets'
reference counters.

Fixes: 636af13f213b ("rtnetlink: Register rtnl_dellink() and rtnl_setlink() with RTNL_FLAG_DOIT_PERNET_WIP.")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Bastien Curutchet (eBPF Foundation) <bastien.curutchet@xxxxxxxxxxx>

It's fixed in 1438f5d07b9a ("rtnetlink: fix netns leak with
rtnl_setlink()").


Oops, I missed it, sorry about that.

Best regards,
Bastien