From eb524f88e6b88960e09388e9f3a12958cf8dbde9 Mon Sep 17 00:00:00 2001 From: zhongjiawei Date: Mon, 18 Sep 2023 16:37:02 +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 --- ...-init-unify-init-fix-its-error-logic.patch | 45 +++++++++++++++++++ runc.spec | 8 +++- series.conf | 1 + 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 patch/0141-runc-libct-init-unify-init-fix-its-error-logic.patch diff --git a/patch/0141-runc-libct-init-unify-init-fix-its-error-logic.patch b/patch/0141-runc-libct-init-unify-init-fix-its-error-logic.patch new file mode 100644 index 0000000..90788cf --- /dev/null +++ b/patch/0141-runc-libct-init-unify-init-fix-its-error-logic.patch @@ -0,0 +1,45 @@ +From a6670de912095206f356b8b7b486d237d1012c88 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 5621c12..910854d 100644 --- a/runc.spec +++ b/runc.spec @@ -2,7 +2,7 @@ Name: docker-runc Version: 1.0.0.rc3 -Release: 214 +Release: 215 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 Sep 18 2023 zhongjiawei - 1.0.0.rc3-215 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix init error return logic + * Tue Aug 22 2023 zhongjiawei - 1.0.0.rc3-214 - Type:bugfix - CVE:NA diff --git a/series.conf b/series.conf index 0652c94..bc5ae68 100644 --- a/series.conf +++ b/series.conf @@ -132,3 +132,4 @@ 0138-runc-libct-fix-shared-pidns-detection.patch 0139-runc-ingore-error-when-force-deleting-a-non-exist-cont.patch 0140-runc-delete-invalid-cgroupinfo-logs.patch +0141-runc-libct-init-unify-init-fix-its-error-logic.patch -- Gitee