[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240917081102.4c00792f@hermes.local>
Date: Tue, 17 Sep 2024 08:11:02 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc: David Ahern <dsahern@...il.com>, netdev@...r.kernel.org, Alexandre
Ferrieux <alexandre.ferrieux@...nge.com>
Subject: Re: [PATCH iproute2] iplink: fix fd leak when playing with netns
On Tue, 17 Sep 2024 08:51:58 +0200
Nicolas Dichtel <nicolas.dichtel@...nd.com> wrote:
> The command 'ip link set foo netns mynetns' opens a file descriptor to fill
> the netlink attribute IFLA_NET_NS_FD. This file descriptor is never closed.
> When batch mode is used, the number of file descriptor may grow greatly and
> reach the maximum file descriptor number that can be opened.
>
> This fd can be closed only after the netlink answer. Let's pass a new
> argument to iplink_parse() to remember this fd and close it.
>
> Fixes: 0dc34c7713bb ("iproute2: Add processless network namespace support")
> Reported-by: Alexandre Ferrieux <alexandre.ferrieux@...nge.com>
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@...nd.com>
> Tested-by: Alexandre Ferrieux <alexandre.ferrieux@...nge.com>
> ---
Maybe netns_fd should be a global variable rather than having to pass
to change all the unrelated function calls.
Powered by blists - more mailing lists