diff --git a/0004-backport-cmd-link-mark-unexported-methods-for-plugins.patch b/0004-backport-cmd-link-mark-unexported-methods-for-plugins.patch new file mode 100644 index 0000000000000000000000000000000000000000..6b9dd4b07c525c5e2263c1abb1c7c8fa199f8c92 --- /dev/null +++ b/0004-backport-cmd-link-mark-unexported-methods-for-plugins.patch @@ -0,0 +1,39 @@ +From c872b0594f716a2a0799b07d7226a45f02c005f1 Mon Sep 17 00:00:00 2001 +From: Cherry Mui +Date: Wed, 16 Mar 2022 13:07:57 -0400 +Subject: [PATCH] cmd/link: mark unexported methods for plugins + +When plugin is used, we already mark all exported methods +reachable. However, when the plugin and the host program share +a common package, an unexported method could also be reachable +from both the plugin and the host via interfaces. We need to mark +them as well. + +Fixes #51621. + +Change-Id: I1a70d3f96b66b803f2d0ab14d00ed0df276ea500 +Reviewed-on: https://go-review.googlesource.com/c/go/+/393365 +Trust: Cherry Mui +Run-TryBot: Cherry Mui +TryBot-Result: Gopher Robot +Reviewed-by: Than McIntosh +--- + src/cmd/link/internal/ld/deadcode.go | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go +index e4fa75f..21a9703 100644 +--- a/src/cmd/link/internal/ld/deadcode.go ++++ b/src/cmd/link/internal/ld/deadcode.go +@@ -350,7 +350,7 @@ func deadcode(ctxt *Link) { + // in the last pass. + rem := d.markableMethods[:0] + for _, m := range d.markableMethods { +- if (d.reflectSeen && m.isExported()) || d.ifaceMethod[m.m] { ++ if (d.reflectSeen && (m.isExported() || d.dynlink)) || d.ifaceMethod[m.m] { + d.markMethod(m) + } else { + rem = append(rem, m) +-- +1.8.3.1 + diff --git a/golang.spec b/golang.spec index 597c7e69ed4486f9601a4e89fc68df108510bf15..f28b76453835e90f28b6d8b853187ee1b15ae8d4 100644 --- a/golang.spec +++ b/golang.spec @@ -66,7 +66,7 @@ Name: golang Version: 1.17.3 -Release: 3 +Release: 4 Summary: The Go Programming Language License: BSD and Public Domain URL: https://golang.org/ @@ -156,6 +156,7 @@ Requires: openEuler-rpm-config Patch6001: 0001-release-branch.go1.17-crypto-elliptic-tolerate-zero-.patch Patch6002: 0002-release-branch.go1.17-encoding-pem-fix-stack-overflo.patch Patch6003: 0003-release-branch.go1.17-syscall-fix-ForkLock-spurious-.patch +Patch6004: 0004-backport-cmd-link-mark-unexported-methods-for-plugins.patch ExclusiveArch: %{golang_arches} @@ -390,6 +391,12 @@ fi %files devel -f go-tests.list -f go-misc.list -f go-src.list %changelog +* Tue Jun 28 2022 Bin Hu - 1.17.3-4 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:backport patch to fix bug of golang plugin mode + * Fri May 6 2022 hanchao - 1.17.3-3 - Type:CVE - CVE:CVE-2021-44717