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