diff --git a/0102-Backport-runtime-implement-SUID-SGID-protections.patch b/0102-Backport-runtime-implement-SUID-SGID-protections.patch index 4d0e51409dd7dcb082a41fe69dbae9b4311482b8..67bb2ce549fef8917be3e14f6dfab87d611ca5a3 100644 --- a/0102-Backport-runtime-implement-SUID-SGID-protections.patch +++ b/0102-Backport-runtime-implement-SUID-SGID-protections.patch @@ -1,4 +1,4 @@ -From eb318de64a49fac50ff18e9f467198113ed7ef33 Mon Sep 17 00:00:00 2001 +From 5da979b4033759d952d64bbc727d1fc45bb785f0 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Tue, 8 Feb 2022 16:45:14 -0500 Subject: [PATCH] runtime: implement SUID/SGID protections @@ -66,7 +66,7 @@ Signed-off-by: Tang Xi tangxi6@huawei.com src/runtime/export_darwin_test.go | 7 - src/runtime/export_unix_test.go | 1 + src/runtime/extern.go | 19 +++ - src/runtime/internal/syscall/asm_linux_386.s | 34 +++++ + src/runtime/internal/syscall/asm_linux_386.s | 34 ++++ .../internal/syscall/asm_linux_amd64.s | 33 ++++ src/runtime/internal/syscall/asm_linux_arm.s | 32 ++++ .../internal/syscall/asm_linux_arm64.s | 29 ++++ @@ -76,7 +76,7 @@ Signed-off-by: Tang Xi tangxi6@huawei.com .../internal/syscall/defs_linux_arm64.go | 7 + src/runtime/internal/syscall/syscall_linux.go | 12 ++ src/runtime/nbpipe_fcntl_libc_test.go | 18 --- - src/runtime/nbpipe_fcntl_unix_test.go | 17 --- + src/runtime/nbpipe_fcntl_unix_test.go | 17 -- src/runtime/nbpipe_test.go | 26 ++-- src/runtime/os2_aix.go | 12 ++ src/runtime/os_aix.go | 40 +++++ @@ -87,11 +87,11 @@ Signed-off-by: Tang Xi tangxi6@huawei.com src/runtime/os_solaris.go | 4 + src/runtime/panic.go | 3 + src/runtime/proc.go | 1 + - src/runtime/security_aix.go | 17 +++ + src/runtime/security_aix.go | 17 ++ src/runtime/security_issetugid.go | 19 +++ src/runtime/security_linux.go | 15 ++ src/runtime/security_nonunix.go | 13 ++ - src/runtime/security_test.go | 143 ++++++++++++++++++ + src/runtime/security_test.go | 145 ++++++++++++++++++ src/runtime/security_unix.go | 72 +++++++++ src/runtime/signal_unix.go | 4 + src/runtime/sys_darwin.go | 27 +++- @@ -113,7 +113,7 @@ Signed-off-by: Tang Xi tangxi6@huawei.com src/runtime/syscall2_solaris.go | 2 + src/runtime/syscall_solaris.go | 1 + src/runtime/testdata/testsuid/main.go | 25 +++ - 52 files changed, 747 insertions(+), 59 deletions(-) + 52 files changed, 749 insertions(+), 59 deletions(-) create mode 100644 src/runtime/internal/syscall/asm_linux_386.s create mode 100644 src/runtime/internal/syscall/asm_linux_amd64.s create mode 100644 src/runtime/internal/syscall/asm_linux_arm.s @@ -930,14 +930,15 @@ index 0000000..19d16ea +func secure() {} diff --git a/src/runtime/security_test.go b/src/runtime/security_test.go new file mode 100644 -index 0000000..d7d5d25 +index 0000000..5653e4f --- /dev/null +++ b/src/runtime/security_test.go -@@ -0,0 +1,143 @@ +@@ -0,0 +1,145 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + ++//go:build aix || android || darwin || dragonfly || freebsd || hurd || illumos || ios || linux || netbsd || openbsd || solaris +// +build aix android darwin dragonfly freebsd hurd illumos ios linux netbsd openbsd solaris + +package runtime_test @@ -948,6 +949,7 @@ index 0000000..d7d5d25 + "fmt" + "internal/testenv" + "io" ++ "io/ioutil" + "os" + "os/exec" + "path/filepath" @@ -1018,7 +1020,7 @@ index 0000000..d7d5d25 + t.Fatal(err) + } + -+ f, err := os.CreateTemp(t.TempDir(), "suid-output") ++ f, err := os.Create(filepath.Join(t.TempDir(), "suid-output")) + if err != nil { + t.Fatal(err) + } @@ -1067,7 +1069,7 @@ index 0000000..d7d5d25 + t.Errorf("unexpected output, got: %q, want %q", output, expected) + } + -+ fc, err := os.ReadFile(tempfilePath) ++ fc, err := ioutil.ReadFile(tempfilePath) + if err != nil { + t.Fatal(err) + } @@ -1578,5 +1580,5 @@ index 0000000..1949d2d + fmt.Fprintf(os.Stderr, "hello\n") +} -- -2.30.2 +2.33.0 diff --git a/golang.spec b/golang.spec index 91a04e75b280b33f981025d016e70f747ab60315..ccb104aa2daeabf5ac2ffa4cac91880386e40a68 100644 --- a/golang.spec +++ b/golang.spec @@ -58,7 +58,7 @@ Name: golang Version: 1.15.7 -Release: 29 +Release: 30 Summary: The Go Programming Language License: BSD and Public Domain URL: https://golang.org/ @@ -483,6 +483,12 @@ fi %files devel -f go-tests.list -f go-misc.list -f go-src.list %changelog +* Fri Jul 7 2023 hanchao - 1.15.7-30 +- Type:bugfix +- CVE: +- SUG:NA +- DESC: fix build error for go test runtime. + * Thu Jun 29 2023 hanchao - 1.15.7-29 - Type:CVE - CVE:CVE-2023-29403