From 81de4123766b9c036e08ad1f9dd0f09f532bd1c5 Mon Sep 17 00:00:00 2001 From: zhongjiawei Date: Mon, 18 Sep 2023 15:52:15 +0800 Subject: [PATCH] =?UTF-8?q?runc=EF=BC=9Afix=20init=20error=20return=20logi?= =?UTF-8?q?c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- git-commit | 2 +- ...-init-unify-init-fix-its-error-logic.patch | 45 +++++++++++++++++++ runc.spec | 8 +++- series.conf | 1 + 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 patch/0149-runc-libct-init-unify-init-fix-its-error-logic.patch diff --git a/git-commit b/git-commit index 7fe8b1f..7a322b2 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -800b2584e8ee3aca01174bcfc0931c0bfc509e8d +a8c0a5b09ea02b2003bd2e4940deef5142170dd2 diff --git a/patch/0149-runc-libct-init-unify-init-fix-its-error-logic.patch b/patch/0149-runc-libct-init-unify-init-fix-its-error-logic.patch new file mode 100644 index 0000000..7c1558c --- /dev/null +++ b/patch/0149-runc-libct-init-unify-init-fix-its-error-logic.patch @@ -0,0 +1,45 @@ +From 66c89bd1455e259d7c7b4fd1d67664c762402e8c Mon Sep 17 00:00:00 2001 +From: Kir Kolyshkin +Date: Wed, 9 Aug 2023 12:04:26 +0900 +Subject: [PATCH] libct/init: unify init, fix its error logic + +Fix init error handling logic. + +The main issues at hand are: +- the "unable to convert _LIBCONTAINER_INITPIPE" error from + StartInitialization is never shown; +- errors from WriteSync and WriteJSON are never shown; + +Generally, our goals are: + - if there's any error, do our best to show it; + - but only show each error once; + +Signed-off-by: Kir Kolyshkin +--- + libcontainer/factory_linux.go | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/libcontainer/factory_linux.go b/libcontainer/factory_linux.go +index e4ef518..0b2aa74 100644 +--- a/libcontainer/factory_linux.go ++++ b/libcontainer/factory_linux.go +@@ -294,13 +294,14 @@ func (l *LinuxFactory) StartInitialization() (err error) { + // We have an error during the initialization of the container's init, + // send it back to the parent process in the form of an initError. + if werr := utils.WriteJSON(pipe, syncT{procError}); werr != nil { +- fmt.Fprintln(os.Stderr, err) ++ fmt.Fprintln(os.Stderr, werr) + return + } + if werr := utils.WriteJSON(pipe, newSystemError(err)); werr != nil { +- fmt.Fprintln(os.Stderr, err) ++ fmt.Fprintln(os.Stderr, werr) + return + } ++ err = nil + }() + defer func() { + if e := recover(); e != nil { +-- +2.33.0 + diff --git a/runc.spec b/runc.spec index 9162f8b..c4886aa 100644 --- a/runc.spec +++ b/runc.spec @@ -4,7 +4,7 @@ Name: docker-runc Version: 1.0.0.rc3 -Release: 312 +Release: 313 Summary: runc is a CLI tool for spawning and running containers according to the OCI specification. License: ASL 2.0 @@ -57,6 +57,12 @@ install -p -m 755 runc $RPM_BUILD_ROOT/%{_bindir}/runc %{_bindir}/runc %changelog +* Mon Sep 18 2023 zhongjiawei - 1.0.0.rc3-313 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix init error return logic + * Tue Aug 22 2023 zhongjiawei - 1.0.0.rc3-312 - Type:bugfix - CVE:NA diff --git a/series.conf b/series.conf index 97ab752..4c3276a 100644 --- a/series.conf +++ b/series.conf @@ -148,4 +148,5 @@ patch/0001-add-loongarch-support-for-libcontainer.patch patch/0146-runc-enable-cpuset-preferred-by-proc-sys-kernel-sche.patch patch/0147-runc-ingore-error-when-force-deleting-a-non-exist-cont.patch patch/0148-runc-delete-invalid-cgroupinfo-logs.patch +patch/0149-runc-libct-init-unify-init-fix-its-error-logic.patch #end -- Gitee