lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bfe6f4f8-b7a3-4ea1-886b-9929c7bf366f@6wind.com>
Date: Tue, 17 Sep 2024 17:17:02 +0200
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: Stephen Hemminger <stephen@...workplumber.org>
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

Le 17/09/2024 à 17:11, Stephen Hemminger a écrit :
> 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.
I hesitated with this option. I don't have any strong opinion on this.

Note that two variables are needed, because the link_util->parse_opt may call
again iplink_parse().

Another note that I forgot to mention: I didn't fix devlink which has the same
problem. I was waiting for the conclusion of this fix first.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ