diff --git a/git-commit b/git-commit index 34f61ed74e87410416723d0ec8d5b8093882c45a..993b1a11d98eba50c113103d8d7e76c534b06875 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -b49101bf7dc504614d65a73bc3a5d8d6033962ff +488a807caede978cbaa888f1854bb38207a573b6 diff --git a/patch/0134-runc-support-specify-umask.patch b/patch/0134-runc-support-specify-umask.patch new file mode 100644 index 0000000000000000000000000000000000000000..c3ece811922728b506bc293d150ecfe0ba18d280 --- /dev/null +++ b/patch/0134-runc-support-specify-umask.patch @@ -0,0 +1,57 @@ +From 9e76966232e71cfabc2553c6a0dee1f59ee9216c Mon Sep 17 00:00:00 2001 +From: zhongjiawei +Date: Sat, 17 Dec 2022 11:18:41 +0800 +Subject: [PATCH] runc:support specify umask + +--- + libcontainer/rootfs_linux.go | 7 ++++++- + libcontainer/setns_init_linux.go | 8 ++++++++ + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go +index a1bd7e7..b005429 100644 +--- a/libcontainer/rootfs_linux.go ++++ b/libcontainer/rootfs_linux.go +@@ -140,7 +140,12 @@ func finalizeRootfs(config *configs.Config) (err error) { + } + } + +- syscall.Umask(0022) ++ umask := libcontainerUtils.SearchLabels(config.Labels, "native.umask") ++ if umask == "normal" { ++ syscall.Umask(0022) ++ } else { ++ syscall.Umask(0027) ++ } + return nil + } + +diff --git a/libcontainer/setns_init_linux.go b/libcontainer/setns_init_linux.go +index e6dfbba..1f7ec98 100644 +--- a/libcontainer/setns_init_linux.go ++++ b/libcontainer/setns_init_linux.go +@@ -11,6 +11,7 @@ import ( + "github.com/opencontainers/runc/libcontainer/keys" + "github.com/opencontainers/runc/libcontainer/seccomp" + "github.com/opencontainers/runc/libcontainer/system" ++ "github.com/opencontainers/runc/libcontainer/utils" + "github.com/opencontainers/selinux/go-selinux/label" + ) + +@@ -42,6 +43,13 @@ func (l *linuxSetnsInit) Init() error { + return err + } + } ++ // set exec process umask to 0027 or 0022 according to container's config ++ umask := utils.SearchLabels(l.config.Config.Labels, "native.umask") ++ if umask == "normal" { ++ syscall.Umask(0022) ++ } else { ++ syscall.Umask(0027) ++ } + if l.config.NoNewPrivileges { + if err := system.Prctl(PR_SET_NO_NEW_PRIVS, 1, 0, 0, 0); err != nil { + return err +-- +2.30.0 + diff --git a/runc.spec b/runc.spec index 2a3327701c70101649b121cd4bbf84ccffa47a4e..55383b55440ac0131305851574d63527e350bd2d 100644 --- a/runc.spec +++ b/runc.spec @@ -4,7 +4,7 @@ Name: docker-runc Version: 1.0.0.rc3 -Release: 305 +Release: 306 Summary: runc is a CLI tool for spawning and running containers according to the OCI specification. License: ASL 2.0 @@ -53,6 +53,12 @@ install -p -m 755 runc $RPM_BUILD_ROOT/%{_bindir}/runc %{_bindir}/runc %changelog +* Sat Dec 17 2022 zhongjiawei - 1.0.0.rc3-306 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:support specify umask + * Tue Aug 16 2022 zhongjiawei - 1.0.0.rc3-305 - Type:bugfix - CVE:NA diff --git a/series.conf b/series.conf index f36b0e83bd48c5c6f49723f6343a9f7ed0c02446..7ad17aaa84fd51ef2b588729add14aa560746ce3 100644 --- a/series.conf +++ b/series.conf @@ -131,4 +131,5 @@ patch/0130-runc-fix-cgroup-info-print-error.patch patch/0131-runc-save-state-atomic.patch patch/0132-runc-change-Umask-to-0022.patch patch/0133-runc-fix-systemd-cgroup-after-memory-type-changed.patch +patch/0134-runc-support-specify-umask.patch #end