]> git.ipfire.org Git - thirdparty/iproute2.git/commit
ipnetns: fix fd leak with 'ip netns set'
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 11 May 2023 14:42:24 +0000 (16:42 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 11 May 2023 21:11:43 +0000 (14:11 -0700)
commit465e87a89c134d28a7fae540d26b27e6a2e1d6c0
tree6935f265cc4aa40b832f3d5e3ee7ae098e021632
parent2905e783479d873c17ab4cb270161a139ccb7f1e
ipnetns: fix fd leak with 'ip netns set'

There is no reason to open this netns file. set_netnsid_from_name() uses
netns_get_fd() for this purpose and uses the returned fd.

Reported-by: Stephen Hemminger <stephen@networkplumber.org>
Fixes: d182ee1307c7 ("ipnetns: allow to get and set netns ids")
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ipnetns.c