From 542207bf0aeeb3c7449c77e4e1a5a02165984617 Mon Sep 17 00:00:00 2001 From: chenjiankun Date: Tue, 13 Sep 2022 19:58:50 +0800 Subject: [PATCH] docker: fix terminal abnormal after docker run fix #I5OBZ9 fix #I5LDB4 fix #I5FTB4 --- VERSION-openeuler | 2 +- docker.spec | 8 ++- git-commit | 2 +- ...x-terminal-abnormal-after-docker-run.patch | 62 +++++++++++++++++++ series.conf | 1 + 5 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 patch/0229-docker-fix-terminal-abnormal-after-docker-run.patch diff --git a/VERSION-openeuler b/VERSION-openeuler index d7576ff..88e5769 100644 --- a/VERSION-openeuler +++ b/VERSION-openeuler @@ -1 +1 @@ -18.09.0.306 +18.09.0.307 diff --git a/docker.spec b/docker.spec index 85f3b87..c62a479 100644 --- a/docker.spec +++ b/docker.spec @@ -1,6 +1,6 @@ Name: docker-engine Version: 18.09.0 -Release: 306 +Release: 307 Summary: The open-source application container engine Group: Tools/Docker @@ -212,6 +212,12 @@ fi %endif %changelog +* Tue Sep 13 2022 chenjiankun - 18.09.0-307 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix terminal abnormal after docker run + * Wed Jun 29 2022 zjw - 18.09.0-306 - Type:CVE - CVE:CVE-2021-41092 diff --git a/git-commit b/git-commit index 44f0e7c..38345a0 100644 --- a/git-commit +++ b/git-commit @@ -1 +1 @@ -1d79dce8b3c1b71f07ef5ad31adfe8026080311f +2cd0f3c6c09e973e3f65dc0051f4fdebe2349fb4 diff --git a/patch/0229-docker-fix-terminal-abnormal-after-docker-run.patch b/patch/0229-docker-fix-terminal-abnormal-after-docker-run.patch new file mode 100644 index 0000000..39b692c --- /dev/null +++ b/patch/0229-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 5033fa4..fc77c75 100644 --- a/series.conf +++ b/series.conf @@ -226,4 +226,5 @@ patch/0225-docker-close-channel-in-write-side-to-avoid-panic-in.patch patch/0226-docker-chrootarchive-don-t-create-parent-dirs-outside-of-ch.patch patch/0227-docker-Lock-down-docker-root-dir-perms.patch patch/0228-docker-registry-ensure-default-auth-config-has-address.patch +patch/0229-docker-fix-terminal-abnormal-after-docker-run.patch #end -- Gitee