From df98c8fc8d4adc5600f13f546fe07405b586c503 Mon Sep 17 00:00:00 2001 From: chenjiankun Date: Thu, 15 Sep 2022 11:08:50 +0800 Subject: [PATCH] [sync]docker: fix terminal abnormal after docker run fix #I5FTB4 fix #I5LDB4 fix #I5OBZ9 (cherry picked from commit b4a83d73a3cdba481691bf29f2f1f17a98d34a14) --- VERSION-openeuler | 2 +- docker-engine-openeuler.spec | 8 ++- ...x-terminal-abnormal-after-docker-run.patch | 62 +++++++++++++++++++ series.conf | 1 + 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 patch/0228-docker-fix-terminal-abnormal-after-docker-run.patch diff --git a/VERSION-openeuler b/VERSION-openeuler index 42c78ee..a5d9c1a 100644 --- a/VERSION-openeuler +++ b/VERSION-openeuler @@ -1 +1 @@ -18.09.0.238 +18.09.0.239 diff --git a/docker-engine-openeuler.spec b/docker-engine-openeuler.spec index 99c8a15..20a5550 100644 --- a/docker-engine-openeuler.spec +++ b/docker-engine-openeuler.spec @@ -1,6 +1,6 @@ Name: docker-engine Version: 18.09.0 -Release: 238 +Release: 239 Summary: The open-source application container engine Group: Tools/Docker @@ -198,6 +198,12 @@ fi %endif %changelog +* Thu Sep 15 2022 chenjiankun - 18.09.0-239 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix terminal abnormal after docker run + * Thu Jun 28 2022 chenjiankun - 18.09.0-238 - Type:CVE - CVE:CVE-2021-41092 diff --git a/patch/0228-docker-fix-terminal-abnormal-after-docker-run.patch b/patch/0228-docker-fix-terminal-abnormal-after-docker-run.patch new file mode 100644 index 0000000..39b692c --- /dev/null +++ b/patch/0228-docker-fix-terminal-abnormal-after-docker-run.patch @@ -0,0 +1,62 @@ +From 886c1473eddbb1a56f7bae116ad155ccb7c7cfb0 Mon Sep 17 00:00:00 2001 +From: chenjiankun +Date: Wed, 10 Aug 2022 16:05:06 +0800 +Subject: [PATCH] docker: fix terminal abnormal after docker run + +when docker run -it xxx bash and exit, the terminal will be abnormal +(no input, no output). +The reason is in golang 1.17, Package reflect's Value methods named +Pointer and UnsafeAddr return type uintptr instead of unsafe. +Pointer to keep callers from changing the result to an arbitrary type +without first importing "unsafe". However, this means that the result +is fragile and must be converted to Pointer immediately after making the call, +in the same expression: + p := (*int)(unsafe.Pointer(reflect.ValueOf(new(int)).Pointer())) +As in the cases above, it is invalid to store the result before the conversion: + // INVALID: uintptr cannot be stored in variable + // before conversion back to Pointer. + u := reflect.ValueOf(new(int)).Pointer() + p := (*int)(unsafe.Pointer(u)) +--- + .../vendor/golang.org/x/sys/unix/syscall_linux.go | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +diff --git a/components/cli/vendor/golang.org/x/sys/unix/syscall_linux.go b/components/cli/vendor/golang.org/x/sys/unix/syscall_linux.go +index 690c2c87f..ca415b73f 100644 +--- a/components/cli/vendor/golang.org/x/sys/unix/syscall_linux.go ++++ b/components/cli/vendor/golang.org/x/sys/unix/syscall_linux.go +@@ -73,19 +73,28 @@ func IoctlSetTermios(fd int, req uint, value *Termios) error { + // from fd, using the specified request number. + func IoctlGetInt(fd int, req uint) (int, error) { + var value int +- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) ++ var err error ++ if _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(unsafe.Pointer(&value))); e1 != 0 { ++ err = errnoErr(e1) ++ } + return value, err + } + + func IoctlGetWinsize(fd int, req uint) (*Winsize, error) { + var value Winsize +- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) ++ var err error ++ if _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(unsafe.Pointer(&value))); e1 != 0 { ++ err = errnoErr(e1) ++ } + return &value, err + } + + func IoctlGetTermios(fd int, req uint) (*Termios, error) { + var value Termios +- err := ioctl(fd, req, uintptr(unsafe.Pointer(&value))) ++ var err error ++ if _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(unsafe.Pointer(&value))); e1 != 0 { ++ err = errnoErr(e1) ++ } + return &value, err + } + +-- +2.23.0 + diff --git a/series.conf b/series.conf index ed89b6a..d2c4c23 100644 --- a/series.conf +++ b/series.conf @@ -221,4 +221,5 @@ patch/0224-docker-close-channel-in-write-side-to-avoid-panic-in.patch patch/0225-docker-chrootarchive-don-t-create-parent-dirs-outside-of-ch.patch patch/0226-docker-Lock-down-docker-root-dir-perms.patch patch/0227-docker-registry-ensure-default-auth-config-has-address.patch +patch/0228-docker-fix-terminal-abnormal-after-docker-run.patch #end -- Gitee