!249 [sync] PR-244: runc:check cmd exist

From: @openeuler-sync-bot 
Reviewed-by: @zhangsong234 
Signed-off-by: @zhangsong234
This commit is contained in:
openeuler-ci-bot 2024-02-06 07:39:18 +00:00 committed by Gitee
commit 57d46706c4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,36 @@
From aff0fc10d4e651b722b40950c794435c55a33034 Mon Sep 17 00:00:00 2001
From: zhongjiawei <zhongjiawei1@huawei.com>
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

View File

@ -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<zhongjiawei1@huawei.com> - 1.0.0.rc3-224
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:check cmd exist
* Thu Feb 1 2024 zhongjiawei<zhongjiawei1@huawei.com> - 1.0.0.rc3-223
- Type:CVE
- CVE:CVE-2024-21626

View File

@ -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