|
| 1 | +From b2429c110d523dad5a0d7ecca43914e75e42a62c Mon Sep 17 00:00:00 2001 |
| 2 | +From: AllSpark < [email protected]> |
| 3 | +Date: Tue, 25 Nov 2025 03:46:49 +0000 |
| 4 | +Subject: [PATCH] vendor(runc): drop EnsureProcHandle checks and helper per |
| 5 | + upstream patch; rely on securejoin.ProcThreadSelf\n\n- Remove |
| 6 | + utils.EnsureProcHandle function\n- Remove its usage in apparmor setProcAttr |
| 7 | + and utils fdRangeFrom\n\nBackport of upstream change. |
| 8 | + |
| 9 | +Signed-off-by: Azure Linux Security Servicing Account < [email protected]> |
| 10 | +Upstream-reference: AI Backport of https://github.com/opencontainers/runc/commit/b3dd1bc562ed9996d1a0f249e056c16624046d28.diff |
| 11 | +--- |
| 12 | + .../runc/libcontainer/apparmor/apparmor_linux.go | 3 --- |
| 13 | + .../runc/libcontainer/utils/utils_unix.go | 16 ---------------- |
| 14 | + 2 files changed, 19 deletions(-) |
| 15 | + |
| 16 | +diff --git a/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go b/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go |
| 17 | +index 8b1483c7..e187dc0d 100644 |
| 18 | +--- a/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go |
| 19 | ++++ b/vendor/github.com/opencontainers/runc/libcontainer/apparmor/apparmor_linux.go |
| 20 | +@@ -40,9 +40,6 @@ func setProcAttr(attr, value string) error { |
| 21 | + } |
| 22 | + defer f.Close() |
| 23 | + |
| 24 | +- if err := utils.EnsureProcHandle(f); err != nil { |
| 25 | +- return err |
| 26 | +- } |
| 27 | + |
| 28 | + _, err = f.WriteString(value) |
| 29 | + return err |
| 30 | +diff --git a/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go b/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go |
| 31 | +index bf3237a2..ec0c1f87 100644 |
| 32 | +--- a/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go |
| 33 | ++++ b/vendor/github.com/opencontainers/runc/libcontainer/utils/utils_unix.go |
| 34 | +@@ -12,18 +12,6 @@ import ( |
| 35 | + "golang.org/x/sys/unix" |
| 36 | + ) |
| 37 | + |
| 38 | +-// EnsureProcHandle returns whether or not the given file handle is on procfs. |
| 39 | +-func EnsureProcHandle(fh *os.File) error { |
| 40 | +- var buf unix.Statfs_t |
| 41 | +- if err := unix.Fstatfs(int(fh.Fd()), &buf); err != nil { |
| 42 | +- return fmt.Errorf("ensure %s is on procfs: %w", fh.Name(), err) |
| 43 | +- } |
| 44 | +- if buf.Type != unix.PROC_SUPER_MAGIC { |
| 45 | +- return fmt.Errorf("%s is not on procfs", fh.Name()) |
| 46 | +- } |
| 47 | +- return nil |
| 48 | +-} |
| 49 | +- |
| 50 | + type fdFunc func(fd int) |
| 51 | + |
| 52 | + // fdRangeFrom calls the passed fdFunc for each file descriptor that is open in |
| 53 | +@@ -35,10 +23,6 @@ func fdRangeFrom(minFd int, fn fdFunc) error { |
| 54 | + } |
| 55 | + defer fdDir.Close() |
| 56 | + |
| 57 | +- if err := EnsureProcHandle(fdDir); err != nil { |
| 58 | +- return err |
| 59 | +- } |
| 60 | +- |
| 61 | + fdList, err := fdDir.Readdirnames(-1) |
| 62 | + if err != nil { |
| 63 | + return err |
| 64 | +-- |
| 65 | +2.45.4 |
| 66 | + |
0 commit comments