From 4431a9137c1a1a16cba799675d270130fa9c81a2 Mon Sep 17 00:00:00 2001 From: zhongjiawei Date: Mon, 5 Feb 2024 17:27:20 +0800 Subject: [PATCH] runc:check cmd exist --- patch/0149-runc-check-cmd-exist.patch | 36 +++++++++++++++++++++++++++ runc.spec | 8 +++++- series.conf | 1 + 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 patch/0149-runc-check-cmd-exist.patch diff --git a/patch/0149-runc-check-cmd-exist.patch b/patch/0149-runc-check-cmd-exist.patch new file mode 100644 index 0000000..01b092b --- /dev/null +++ b/patch/0149-runc-check-cmd-exist.patch @@ -0,0 +1,36 @@ +From aff0fc10d4e651b722b40950c794435c55a33034 Mon Sep 17 00:00:00 2001 +From: zhongjiawei +Date: Mon, 5 Feb 2024 17:24:25 +0800 +Subject: [PATCH] runc:check cmd exist + +--- + libcontainer/setns_init_linux.go | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/libcontainer/setns_init_linux.go b/libcontainer/setns_init_linux.go +index e38165d..74a91a6 100644 +--- a/libcontainer/setns_init_linux.go ++++ b/libcontainer/setns_init_linux.go +@@ -6,6 +6,7 @@ package libcontainer + import ( + "fmt" + "os" ++ "os/exec" + "syscall" + + "github.com/opencontainers/runc/libcontainer/apparmor" +@@ -64,6 +65,11 @@ func (l *linuxSetnsInit) Init() error { + if err := finalizeNamespace(l.config); err != nil { + return err + } ++ // Check for the arg early to make sure it exists. ++ _, err := exec.LookPath(l.config.Args[0]) ++ if err != nil { ++ return err ++ } + if err := apparmor.ApplyProfile(l.config.AppArmorProfile); err != nil { + return err + } +-- +2.33.0 + diff --git a/runc.spec b/runc.spec index d8950ce..b6b6a31 100644 --- a/runc.spec +++ b/runc.spec @@ -2,7 +2,7 @@ Name: docker-runc Version: 1.0.0.rc3 -Release: 223 +Release: 224 Summary: runc is a CLI tool for spawning and running containers according to the OCI specification. License: ASL 2.0 @@ -41,6 +41,12 @@ install -p -m 755 runc $RPM_BUILD_ROOT/%{_bindir}/runc %{_bindir}/runc %changelog +* Mon Feb 5 2024 zhongjiawei - 1.0.0.rc3-224 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:check cmd exist + * Thu Feb 1 2024 zhongjiawei - 1.0.0.rc3-223 - Type:CVE - CVE:CVE-2024-21626 diff --git a/series.conf b/series.conf index f9e40a3..583fa8a 100644 --- a/series.conf +++ b/series.conf @@ -140,3 +140,4 @@ 0146-runc-delete-do-not-ignore-error-from-destroy.patch 0147-runc-libct-Destroy-don-t-proceed-in-case-of-errors.patch 0148-runc-fix-CVE-2024-21626.patch +0149-runc-check-cmd-exist.patch -- Gitee