Skip to content

Commit 94e29d8

Browse files
jefferytograysky2
authored andcommitted
golang: Update to 1.17.5, add patch
Includes fixes for: * CVE-2021-44716: unbounded growth of HTTP/2 header canonicalization cache * CVE-2021-44717: syscall.ForkExec error can close file descriptor 0 Added patches: * 001-cmd-link-use-gold-on-ARM-ARM64-only-if-gold-is-available.patch: golang/go#49748 backported for Go 1.17, this removes the requirement for the gold linker when building Go programs that use Go plugins on arm/arm64 Signed-off-by: Jeffery To <[email protected]>
1 parent f5214d8 commit 94e29d8

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

lang/golang/golang/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
include $(TOPDIR)/rules.mk
99

1010
GO_VERSION_MAJOR_MINOR:=1.17
11-
GO_VERSION_PATCH:=3
11+
GO_VERSION_PATCH:=5
1212

1313
PKG_NAME:=golang
1414
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH))
@@ -20,7 +20,7 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \
2020

2121
PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz
2222
PKG_SOURCE_URL:=$(GO_SOURCE_URLS)
23-
PKG_HASH:=705c64251e5b25d5d55ede1039c6aa22bea40a7a931d14c370339853643c3df0
23+
PKG_HASH:=3defb9a09bed042403195e872dcbc8c6fae1485963332279668ec52e80a95a2d
2424

2525
PKG_MAINTAINER:=Jeffery To <[email protected]>
2626
PKG_LICENSE:=BSD-3-Clause
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
This is https://github.com/golang/go/pull/49748 backported for Go 1.17.
2+
3+
--- a/src/cmd/link/internal/ld/lib.go
4+
+++ b/src/cmd/link/internal/ld/lib.go
5+
@@ -1388,23 +1388,18 @@ func (ctxt *Link) hostlink() {
6+
}
7+
8+
if ctxt.Arch.InFamily(sys.ARM, sys.ARM64) && buildcfg.GOOS == "linux" {
9+
- // On ARM, the GNU linker will generate COPY relocations
10+
- // even with -znocopyreloc set.
11+
+ // On ARM, older versions of the GNU linker will generate
12+
+ // COPY relocations even with -znocopyreloc set.
13+
// https://sourceware.org/bugzilla/show_bug.cgi?id=19962
14+
//
15+
- // On ARM64, the GNU linker will fail instead of
16+
- // generating COPY relocations.
17+
+ // On ARM64, older versions of the GNU linker will fail
18+
+ // instead of generating COPY relocations.
19+
//
20+
- // In both cases, switch to gold.
21+
- altLinker = "gold"
22+
-
23+
- // If gold is not installed, gcc will silently switch
24+
- // back to ld.bfd. So we parse the version information
25+
- // and provide a useful error if gold is missing.
26+
+ // In both cases, switch to gold if gold is available.
27+
cmd := exec.Command(*flagExtld, "-fuse-ld=gold", "-Wl,--version")
28+
if out, err := cmd.CombinedOutput(); err == nil {
29+
- if !bytes.Contains(out, []byte("GNU gold")) {
30+
- log.Fatalf("ARM external linker must be gold (issue #15696), but is not: %s", out)
31+
+ if bytes.Contains(out, []byte("GNU gold")) {
32+
+ altLinker = "gold"
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)