From 111e8dcc0d6e6739d31d247d00ef44d5f7d21ec4 Mon Sep 17 00:00:00 2001 From: Evan Phoenix Date: Fri, 24 Jan 2025 11:53:36 -0800 Subject: [PATCH] libcontainer: Use MaxInt32 as the last FD to match kernel size semantics Signed-off-by: Evan Phoenix --- libcontainer/utils/utils_unix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libcontainer/utils/utils_unix.go b/libcontainer/utils/utils_unix.go index c8ad559d9..55933b7d4 100644 --- a/libcontainer/utils/utils_unix.go +++ b/libcontainer/utils/utils_unix.go @@ -102,7 +102,7 @@ func fdRangeFrom(minFd int, fn fdFunc) error { func CloseExecFrom(minFd int) error { // Use close_range(CLOSE_RANGE_CLOEXEC) if possible. if haveCloseRangeCloexec() { - err := unix.CloseRange(uint(minFd), math.MaxUint, unix.CLOSE_RANGE_CLOEXEC) + err := unix.CloseRange(uint(minFd), math.MaxInt32, unix.CLOSE_RANGE_CLOEXEC) return os.NewSyscallError("close_range", err) } // Otherwise, fall back to the standard loop.