[sync]docker: fix terminal abnormal after docker run
fix #I5FTB4 fix #I5LDB4 fix #I5OBZ9 (cherry picked from commit b4a83d73a3cdba481691bf29f2f1f17a98d34a14)
This commit is contained in:
parent
4f81b515cd
commit
b0de51e996
@ -1 +1 @@
|
||||
18.09.0.238
|
||||
18.09.0.239
|
||||
|
||||
@ -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 <chenjiankun1@huawei.com> - 18.09.0-239
|
||||
- Type:bugfix
|
||||
- CVE:NA
|
||||
- SUG:NA
|
||||
- DESC:fix terminal abnormal after docker run
|
||||
|
||||
* Thu Jun 28 2022 chenjiankun <chenjiankun1@huawei.com> - 18.09.0-238
|
||||
- Type:CVE
|
||||
- CVE:CVE-2021-41092
|
||||
|
||||
@ -0,0 +1,62 @@
|
||||
From 886c1473eddbb1a56f7bae116ad155ccb7c7cfb0 Mon Sep 17 00:00:00 2001
|
||||
From: chenjiankun <chenjiankun1@huawei.com>
|
||||
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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user