Files
runc/tests
Kir Kolyshkin 5a221f44aa libcontainer: set close-on-exec on all fds we open
File descriptors created via the os package are close-on-exec by
default, but the raw syscall wrappers do exactly what they are told,
and a few call sites forgot to ask for it:

 * registerMemoryEventV2 creates an inotify descriptor which is kept
   open for the whole lifetime of the container by the OOM notifier
   goroutine, so it would leak into every "runc exec" process.

 * pivotRoot opens the old root, which is only needed until the
   pivot_root(2) dance is over.

 * readArgString in the seccomp agent opens /proc/PID/mem.

None of these descriptors are meant to be inherited, so set O_CLOEXEC
(IN_CLOEXEC for inotify).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2026-10-25 22:25:58 -07:00
..
2026-10-02 16:59:33 -07:00