-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do not use memfd if kernel version < 5.5
- Loading branch information
1 parent
e21dff5
commit 0101982
Showing
2 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/libcontainer/exeseal/cloned_binary_linux.go b/libcontainer/exeseal/cloned_binary_linux.go | ||
index 0c8231ee..f716451d 100644 | ||
--- a/libcontainer/exeseal/cloned_binary_linux.go | ||
+++ b/libcontainer/exeseal/cloned_binary_linux.go | ||
@@ -47,8 +47,12 @@ func sealMemfd(f **os.File) error { | ||
// errors because they are not needed and we want to continue | ||
// to work on older kernels. | ||
fd := (*f).Fd() | ||
+ // Prior to kernel Linux 5.5 F_SEAL_FUTURE_WRITE has bug which maps memory as shared | ||
+ // between processes even if it is set as private. | ||
+ // https://github.com/torvalds/linux/commit/05d351102dbe4e103d6bdac18b1122cd3cd04925 | ||
+ // https://github.com/opencontainers/runc/pull/4641 | ||
// F_SEAL_FUTURE_WRITE -- Linux 5.1 | ||
- _, _ = unix.FcntlInt(fd, unix.F_ADD_SEALS, unix.F_SEAL_FUTURE_WRITE) | ||
+ // _, _ = unix.FcntlInt(fd, unix.F_ADD_SEALS, unix.F_SEAL_FUTURE_WRITE) | ||
// F_SEAL_EXEC -- Linux 6.3 | ||
const F_SEAL_EXEC = 0x20 //nolint:revive // this matches the unix.* name | ||
_, _ = unix.FcntlInt(fd, unix.F_ADD_SEALS, F_SEAL_EXEC) |