Skip to content

Commit d9914ff

Browse files
committed
Fix the fd leaking to aardvark-dns.
The openDirectory function is missing the unix.O_CLOEXEC flag. As a result, this file descriptor can leak into the aardvark-dns process which can then block the umount of rootfs - in this case, the umount fails with "Device or Resource busy" error message. This commits adds the unix.O_CLOEXEC to unix.Open call, resulting in this fd to be closed on aardvark-dns exec. Signed-off-by: Jan Kaluza <[email protected]>
1 parent f691fa7 commit d9914ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libpod/container_internal_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ func (c *Container) getOCICgroupPath() (string, error) {
440440
}
441441

442442
func openDirectory(path string) (fd int, err error) {
443-
return unix.Open(path, unix.O_RDONLY|unix.O_PATH, 0)
443+
return unix.Open(path, unix.O_RDONLY|unix.O_PATH|unix.O_CLOEXEC, 0)
444444
}
445445

446446
func (c *Container) addNetworkNamespace(g *generate.Generator) error {

0 commit comments

Comments
 (0)