Files
iproute2-next/ip
Nicolas Dichtel 57daf8ff8c iplink: fix fd leak when playing with netns
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. Moreover, a second
fd could be opened because some (struct link_util)->parse_opt() handlers
call iplink_parse().

Let's add a helper to manage these fds:
 - open_fds_add() stores a fd, up to 5 (arbitrary choice, it seems enough);
 - open_fds_close() closes all stored fds.

Fixes: 0dc34c7713 ("iproute2: Add processless network namespace support")
Reported-by: Alexandre Ferrieux <alexandre.ferrieux@orange.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2024-09-28 09:24:56 -07:00
..
2006-08-08 12:11:23 -07:00
2017-11-24 12:21:35 -08:00
2023-01-14 09:00:34 -08:00
2024-04-23 09:01:46 -07:00
2024-03-03 22:29:19 +00:00
2023-01-14 09:00:34 -08:00
2023-01-14 09:00:34 -08:00
2023-01-14 09:00:34 -08:00
2023-01-14 09:00:34 -08:00
2023-01-14 09:00:34 -08:00
2017-11-24 12:21:35 -08:00
2023-01-14 09:00:34 -08:00
2022-03-20 17:40:22 -06:00
2017-11-24 12:21:35 -08:00
2023-01-14 09:00:34 -08:00
2023-01-14 09:00:34 -08:00
2023-03-30 09:45:54 -06:00
2023-01-14 09:00:34 -08:00
2024-08-09 14:32:46 +00:00
2017-11-24 12:21:35 -08:00
2018-06-15 11:15:14 -07:00
2017-11-24 12:21:35 -08:00
2017-11-24 12:21:35 -08:00
2023-01-14 09:00:34 -08:00
2023-01-14 09:00:34 -08:00
2023-01-14 09:00:34 -08:00
2021-06-26 04:40:57 +00:00
2023-01-14 09:00:34 -08:00
2024-08-02 10:47:39 -07:00
2023-01-14 09:00:34 -08:00
2023-01-14 09:00:34 -08:00
2023-01-14 09:00:34 -08:00
2024-02-26 12:25:27 -08:00
2024-06-04 22:53:26 +00:00
2023-11-17 09:16:14 -08:00
2023-11-17 09:16:14 -08:00
2023-11-17 09:16:14 -08:00
2023-11-17 09:16:14 -08:00
2023-01-14 09:00:34 -08:00
2023-11-17 09:16:14 -08:00
2023-11-17 09:16:14 -08:00
2023-11-22 19:27:45 +00:00
2021-09-06 16:31:24 -06:00
2023-01-14 09:00:34 -08:00
2024-05-13 22:23:55 -07:00
2017-11-24 12:21:35 -08:00
2023-01-14 09:00:34 -08:00
2023-01-14 09:00:34 -08:00
2023-01-14 09:00:34 -08:00
2024-06-04 22:53:26 +00:00