aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-02-04[release-branch.go1.14] go1.14.15go1.14.15release-branch.go1.14Carlos Amedee
Change-Id: I8b8891ff335a44664c931acddb705bea453069db Reviewed-on: https://go-review.googlesource.com/c/go/+/289693 Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org> Trust: Alexander Rakoczy <alex@golang.org> Trust: Carlos Amedee <carlos@golang.org>
2021-02-04[release-branch.go1.14] runtime/cgo: fix Android build with NDK 22Elias Naur
Fixes #43405 Change-Id: I7d2b70098a4ba4dcb325fb0be076043789b86135 Reviewed-on: https://go-review.googlesource.com/c/go/+/280312 Run-TryBot: Elias Naur <mail@eliasnaur.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Elias Naur <mail@eliasnaur.com> (cherry picked from commit 1d78139128d6d839d7da0aeb10b3e51b6c7c0749) Reviewed-on: https://go-review.googlesource.com/c/go/+/289150
2021-02-02[release-branch.go1.14] cmd/go: don't lookup the path for CC when invoking cgoJay Conrod
Previously, if CC was a path without separators (like gcc or clang), we'd look it up in PATH in cmd/go using internal/execabs.LookPath, then pass the resolved path to cgo in CC. This caused a regression: if the directory in PATH containing CC has a space, cgo splits it and interprets it as multiple arguments. With this change, cmd/go no longer resolves CC before invoking cgo. cgo does the path lookup on each invocation. This reverts the security fix CL 284780, but that was redundant with the addition of internal/execabs (CL 955304), which still protects us. NOTE: This CL includes a related test fix from CL 286292. Fixes #43859 Change-Id: I65d91a1e303856df8653881eb6e2e75a3bf95c49 Reviewed-on: https://go-review.googlesource.com/c/go/+/285873 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry picked from commit a2cef9b544708ecae983ed8836ee2425a28aab68) Reviewed-on: https://go-review.googlesource.com/c/go/+/285952
2021-02-01[release-branch.go1.14] net/http: update bundled x/net/http2Damien Neil
Updates bundled http2 to x/net git rev 4acb7895a for: http2: send a nil error if we cancel a delayed body write https://golang.org/cl/288114 http2: wait until the request body has been written https://golang.org/cl/288113 Created by: go get -d golang.org/x/net@release-branch.go1.14 go mod tidy go mod vendor go generate -run=bundle std Fixes #42586. Change-Id: Ib5aecaeb1deb13b8f0e51a864b60eede248aef0d Reviewed-on: https://go-review.googlesource.com/c/go/+/288115 Trust: Damien Neil <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-21[release-branch.go1.14] cmd/compile: don't short-circuit copies whose source ↵Keith Randall
is volatile Current optimization: When we copy a->b and then b->c, we might as well copy a->c instead of b->c (then b might be dead and go away). *Except* if a is a volatile location (might be clobbered by a call). In that case, we really do want to copy a immediately, because there might be a call before we can do the a->c copy. User calls can't happen in between, because the rule matches up the memory states. But calls inserted for memory barriers, particularly runtime.typedmemmove, can. (I guess we could introduce a register-calling-convention version of runtime.typedmemmove, but that seems a bigger change than this one.) Fixes #43574 Change-Id: Ifa518bb1a6f3a8dd46c352d4fd54ea9713b3eb1a Reviewed-on: https://go-review.googlesource.com/c/go/+/282492 Trust: Keith Randall <khr@golang.org> Trust: Josh Bleecher Snyder <josharian@gmail.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> (cherry picked from commit 304f769ffc68e64244266b3aadbf91e6738c0064) Reviewed-on: https://go-review.googlesource.com/c/go/+/282559
2021-01-21[release-branch.go1.14] internal/execabs: only run tests on platforms that ↵Roland Shoemaker
support them Fixes #43792 Change-Id: I3bf022a28b194f0089ea96d93e56bbd9fb7e0aa8 Reviewed-on: https://go-review.googlesource.com/c/go/+/285055 Trust: Roland Shoemaker <roland@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-01-20[release-branch.go1.14] cmd/go: fix mod_get_fallback testJay Conrod
Fixes #43796 Change-Id: I3d791d0ac9ce0b523c78c649aaf5e339a7f63b76 Reviewed-on: https://go-review.googlesource.com/c/go/+/284797 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> TryBot-Result: Go Bot <gobot@golang.org> (cherry picked from commit be28e5abc5ddca0d6b2d8c91b7bb9c05717154e7) Reviewed-on: https://go-review.googlesource.com/c/go/+/284798
2021-01-19[release-branch.go1.14] all: merge release-branch.go1.14-security into ↵Roland Shoemaker
release-branch.go1.14 Change-Id: I32a354618306a72315048c3b5943ed46e1036e25
2021-01-19[release-branch.go1.14-security] go1.14.14go1.14.14Dmitri Shuralyov
Change-Id: Id4260bbb5aa55b7e93c0c4686f174ea7916c14db Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/957919 Reviewed-by: Roland Shoemaker <bracewell@google.com>
2021-01-19[release-branch.go1.14-security] cmd/go: overwrite program name with full pathRoland Shoemaker
If the program path is resolved, replace the first argument of the exec.Cmd, which is the bare program name with the resolved path. Change-Id: I92cf5e6f4bb7c8fef9b59f5eab963f4e75b90d07 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/957908 Reviewed-by: Katie Hockman <katiehockman@google.com> Reviewed-by: Russ Cox <rsc@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from commit a863cb56b33a24aad88f23f1d48629dc4b4b9539) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/958253 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2021-01-15[release-branch.go1.14-security] all: introduce and use internal/execabsRoland Shoemaker
Introduces a wrapper around os/exec, internal/execabs, for use in all commands. This wrapper prevents exec.LookPath and exec.Command from running executables in the current directory. All imports of os/exec in non-test files in cmd/ are replaced with imports of internal/execabs. This issue was reported by RyotaK. Fixes CVE-2021-3115 Change-Id: I0423451a6e27ec1e1d6f3fe929ab1ef69145c08f Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/955304 Reviewed-by: Russ Cox <rsc@google.com> Reviewed-by: Katie Hockman <katiehockman@google.com> (cherry picked from commit 44f09a6990ccf4db601cbf8208c89ac4e888f884) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/955309
2021-01-15[release-branch.go1.14-security] cmd/go: add test case for cgo CC settingRuss Cox
Change-Id: Ied986053a64447c5eac6369f6c9b69ed3d3f94d9 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/949415 Reviewed-by: Ian Lance Taylor <iant@google.com> (cherry picked from commit e97d4ed8dcc1fed64fe44b56dfdfb0f929aabb65) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/955298 Reviewed-by: Katie Hockman <katiehockman@google.com>
2021-01-16[release-branch.go1.14-security] cmd/cgo: report exec errors a bit more clearlyRuss Cox
Change-Id: I0e6bebf0e2e6efdef4be880e0c6c7451b938924b Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/949417 Reviewed-by: Katie Hockman <katiehockman@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> (cherry picked from commit 4c2e5f85dda6ad5cc1d5be863ae62f2050f12be9) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/955296
2021-01-16[release-branch.go1.14-security] cmd/go: pass resolved CC, GCCGO to cgoRuss Cox
This makes sure the go command and cgo agree about exactly which compiler is being used. This issue was reported by RyotaK. Fixes CVE-2021-3115. Change-Id: If171c5c8b2523efb5ea2d957e5ad1380a038149c Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/949416 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from commit 4cf399ca38587a6e4a3e85b494cd9a9b4cc53378) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/955294 Reviewed-by: Katie Hockman <katiehockman@google.com>
2021-01-16[release-branch.go1.14-security] crypto/elliptic: fix P-224 field reductionFilippo Valsorda
This patch fixes two independent bugs in p224Contract, the function that performs the final complete reduction in the P-224 field. Incorrect outputs due to these bugs were observable from a high-level P224().ScalarMult() call. The first bug was in the calculation of out3GT. That mask was supposed to be all ones if the third limb of the value is greater than the third limb of P (out[3] > 0xffff000). Instead, it was also set if they are equal. That meant that if the third limb was equal, the value was always considered greater than or equal to P, even when the three bottom limbs were all zero. There is exactly one affected value, P - 1, which would trigger the subtraction by P even if it's lower than P already. The second bug was more easily hit, and is the one that caused the known high-level incorrect output: after the conditional subtraction by P, a potential underflow of the lowest limb was not handled. Any values that trigger the subtraction by P (values between P and 2^224-1, and P - 1 due to the bug above) but have a zero lowest limb would produce invalid outputs. Those conditions apply to the intermediate representation before the subtraction, so they are hard to trace to precise inputs. This patch also adds a test suite for the P-224 field arithmetic, including a custom fuzzer that automatically explores potential edge cases by combining limb values that have various meanings in the code. contractMatchesBigInt in TestP224Contract finds the second bug in less than a second without being tailored to it, and could eventually find the first one too by combining 0, (1 << 28) - 1, and the difference of (1 << 28) and (1 << 12). The incorrect P224().ScalarMult() output was found by the elliptic-curve-differential-fuzzer project running on OSS-Fuzz and reported by Philippe Antoine (Catena cyber). Fixes CVE-2021-3114 Change-Id: I50176602d544de3da854270d66a293bcaca57ad7 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/947792 Reviewed-by: Katie Hockman <katiehockman@google.com> (cherry picked from commit 5fa534e9c7eaeaf875e53b98eac9342b0855b283) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/955313
2020-12-03[release-branch.go1.14] go1.14.13go1.14.13Carlos Amedee
Change-Id: Ifdfd9cd7edb8c3afd785cf75e818e3d301cd8dae Reviewed-on: https://go-review.googlesource.com/c/go/+/275133 Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Trust: Carlos Amedee <carlos@golang.org>
2020-12-03[release-branch.go1.14] cmd/compile: sign extend constant folding properlyKeith Randall
MOVLconst must have a properly sign-extended auxint constant. The bit operations in these rules don't enforce that invariant. Fixes #42755 Change-Id: I729afcad18752d9b7739e49709020e3be7b3653e Reviewed-on: https://go-review.googlesource.com/c/go/+/272030 Trust: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
2020-11-20[release-branch.go1.14] runtime: block signals in needm before allocating MIan Lance Taylor
Otherwise, if a signal occurs just after we allocated the M, we can deadlock if the signal handler needs to allocate an M itself. For #42207 Fixes #42635 Change-Id: I76f44547f419e8b1c14cbf49bf602c6e645d8c14 Reviewed-on: https://go-review.googlesource.com/c/go/+/265759 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry picked from commit 368c40116434532dc0b53b72fa04788ca6742898) Reviewed-on: https://go-review.googlesource.com/c/go/+/271848
2020-11-16[release-branch.go1.14] cmd/go: permit CGO_LDFLAGS to appear in //go:ldflagIan Lance Taylor
For #42565 Fixes #42566 Change-Id: If7cf39905d124dbd54dfac6a53ee38270498efed Reviewed-on: https://go-review.googlesource.com/c/go/+/269818 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from commit 782cf560db4c919790fdb476d1bbe18e5ddf5ffd) Reviewed-on: https://go-review.googlesource.com/c/go/+/270080
2020-11-12[release-branch.go1.14] all: merge release-branch.go1.14-security into ↵Katie Hockman
release-branch.go1.14 Change-Id: I87a2c27ce88913c2867ef355d589debfbb522167
2020-11-12[release-branch.go1.14-security] go1.14.12go1.14.12Carlos Amedee
Change-Id: I8ce7093f7e119216d3a5d8941968788b70b6afaf Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/901408 Reviewed-by: Katie Hockman <katiehockman@google.com>
2020-11-12[release-branch.go1.14-security] math/big: fix shift for recursive divisionKatie Hockman
The previous s value could cause a crash for certain inputs. Will check in tests and documentation improvements later. Thanks to the Go Ethereum team and the OSS-Fuzz project for reporting this. Thanks to Rémy Oudompheng and Robert Griesemer for their help developing and validating the fix. Fixes CVE-2020-28362 Change-Id: Ibbf455c4436bcdb07c84a34fa6551fb3422356d3 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/899974 Reviewed-by: Roland Shoemaker <bracewell@google.com> Reviewed-by: Filippo Valsorda <valsorda@google.com> (cherry picked from commit 28015462c2a83239543dc2bef651e9a5f234b633) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/901064
2020-11-12[release-branch.go1.14-security] cmd/go: in cgoflags, permit -DX1, prohibit ↵Ian Lance Taylor
-Wp,-D,opt Restrict -D and -U to ASCII C identifiers, but do permit trailing digits. When using -Wp, prohibit commas in -D values. Thanks to Imre Rad (https://www.linkedin.com/in/imre-rad-2358749b) for reporting this. Fixes CVE-2020-28367 Change-Id: Ibfc4dfdd6e6c258e131448e7682610c44eee9492 Reviewed-on: https://go-review.googlesource.com/c/go/+/267277 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/899923 Reviewed-by: Filippo Valsorda <valsorda@google.com>
2020-11-12[release-branch.go1.14-security] cmd/go, cmd/cgo: don't let bogus symbol set ↵Ian Lance Taylor
cgo_ldflag A hand-edited object file can have a symbol name that uses newline and other normally invalid characters. The cgo tool will generate Go files containing symbol names, unquoted. That can permit those symbol names to inject Go code into a cgo-generated file. If that Go code uses the //go:cgo_ldflag pragma, it can cause the C linker to run arbitrary code when building a package. If you build an imported package we permit arbitrary code at run time, but we don't want to permit it at package build time. This CL prevents this in two ways. In cgo, reject invalid symbols that contain non-printable or space characters, or that contain anything that looks like a Go comment. In the go tool, double check all //go:cgo_ldflag directives in generated code, to make sure they follow the existing LDFLAG restrictions. Thanks to Chris Brown and Tempus Ex for reporting this. Fixes CVE-2020-28366 Change-Id: Ia1ad8f3791ea79612690fa7d26ac451d0f6df7c1 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/895832 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> (cherry picked from commit 6bc814dd2bbfeaafa41d314dd4cc591b575dfbf6) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/901055 Reviewed-by: Filippo Valsorda <valsorda@google.com> Reviewed-by: Roland Shoemaker <bracewell@google.com>
2020-11-05[release-branch.go1.14] go1.14.11go1.14.11Alexander Rakoczy
Change-Id: I1b4231179d0825113f2cbb6e84e92b3453e2ee45 Reviewed-on: https://go-review.googlesource.com/c/go/+/267878 Run-TryBot: Alexander Rakoczy <alex@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Trust: Alexander Rakoczy <alex@golang.org>
2020-10-30[release-branch.go1.14] net/http: update bundled x/net/http2Dmitri Shuralyov
Bring in the change in CL 266157 with: go get -d golang.org/x/net@release-branch.go1.14 go mod tidy go mod vendor go generate -run=bundle std Updates #39337. Fixes #42112. Change-Id: Iefd0012369c7f0c58201256e29d21210cb9f2f7a Reviewed-on: https://go-review.googlesource.com/c/go/+/266374 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Dmitri Shuralyov <dmitshur@golang.org>
2020-10-30[release-branch.go1.14] cmd/go/internal/modfetch: drop ↵Tobias Klauser
gopkg.in/russross/blackfriday.v2 from TestCodeRepoVersions Follow-up for CL 265819. Given the -pre tag added recently, a new stable version is likely tagged soon. This would break TestCodeRepoVersions on the longtest builders again. Since the other test cases in codeRepoVersionsTests already provide enough coverage, drop gopkg.in/russross/blackfriday.v2 to avoid breaking TestCodeRepoVersions once the release happens. Updates #28856 Change-Id: If86a637b5e47f59faf9048fc1cbbae6e8f1dcc53 Reviewed-on: https://go-review.googlesource.com/c/go/+/265917 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> (cherry picked from commit 421d4e72de802ed65cb38317660654771cfb13e9) Reviewed-on: https://go-review.googlesource.com/c/go/+/266178 Trust: Dmitri Shuralyov <dmitshur@golang.org> Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> (cherry picked from commit 8687f6d924ee3a311e08db855c6dc1024c1f9349) Reviewed-on: https://go-review.googlesource.com/c/go/+/266302 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-10-29[release-branch.go1.14] time: fix LoadLocationFromTZData with slim tzdataChristopher Hlubek
The extend information of a time zone file with last transition < now could result in a wrong cached zone because it used the zone of the last transition. This could lead to wrong zones in systems with slim zoneinfo. Fixes #42155 Change-Id: I7c57c35b5cfa58482ac7925b5d86618c52f5444d Reviewed-on: https://go-review.googlesource.com/c/go/+/264939 Trust: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 70e022e4a83dc996ac4f108e811fbc399ad5565b) Reviewed-on: https://go-review.googlesource.com/c/go/+/266303 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-10-29[release-branch.go1.14] time: support slim tzdata formatIan Lance Taylor
Backport of part of https://golang.org/cl/261877 to support the slim tzdata format. As of tzdata 2020b, the default is to use the slim format. We need to support that format so that Go installations continue to work when tzdata is updated. Relevant part of the CL description: The reason for the failed tests was that when caching location data, the extended time format past the end of zone transitions was not considered. The respective change was introduced in (*Location).lookup by CL 215539. For #42155 Change-Id: I37f52a0917b2c6e3957e6b4612c8ef104c736e65 Reviewed-on: https://go-review.googlesource.com/c/go/+/264301 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> (cherry picked from commit 414668cfbc41fd8cadf74e981849d1e05cc23b2e) Reviewed-on: https://go-review.googlesource.com/c/go/+/266298 Run-TryBot: Ian Lance Taylor <iant@golang.org>
2020-10-29[release-branch.go1.14] time: use extended time format past end of zone ↵Ian Lance Taylor
transitions This gives us better expected information for daylight savings time transitions in year 2038 and beyond. For #36654 For #42155 Change-Id: I5a39aed3c40b184e1d7bb7d6ce3aff5307c4c146 Reviewed-on: https://go-review.googlesource.com/c/go/+/215539 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit b71eafbcece175db33acfb205e9090ca99a8f984) Reviewed-on: https://go-review.googlesource.com/c/go/+/264302 Trust: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
2020-10-23[release-branch.go1.14] net/http: deep copy Request.TransferEncodingdqu123
The existing implementation in Request.Clone() assigns the wrong pointer to r2.TransferEncoding. Updates #41907. Fixes #41913. Change-Id: I7f220a41b1b46a55d1a1005e47c6dd69478cb025 Reviewed-on: https://go-review.googlesource.com/c/go/+/261377 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Carlos Amedee <carlos@golang.org> Trust: Emmanuel Odeke <emm.odeke@gmail.com>
2020-10-22[release-branch.go1.14] src, net/http: update vendor, regenerate h2_bundle.goEmmanuel T Odeke
Features CL: net/http2: send WINDOW_UPDATE on a body's write failure (fixes #41386) https://golang.org/cl/258497 Created by: go get -d golang.org/x/net@release-branch.go1.14 go mod tidy go mod vendor go generate -run=bundle std Updates #40423 Fixes #41386 Change-Id: I3e75527d381dd4c4262db5f2ff755029d448c48b Reviewed-on: https://go-review.googlesource.com/c/go/+/258538 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Trust: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
2020-10-20[release-branch.go1.14] runtime: wait for preemption signals before syscall.ExecIan Lance Taylor
For #41702 For #41703 For #42023 Change-Id: If07f40b1d73b8f276ee28ffb8b7214175e56c24d Reviewed-on: https://go-review.googlesource.com/c/go/+/262817 Trust: Ian Lance Taylor <iant@golang.org> Trust: Bryan C. Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> (cherry picked from commit 05739d6f17c57f09264272621b88725a463234d0) Reviewed-on: https://go-review.googlesource.com/c/go/+/264023
2020-10-20[release-branch.go1.14] syscall: use MustHaveExec in TestExecIan Lance Taylor
For #41702 For #41703 Change-Id: Ib2b15e52aa1fef2f5e644b316c726150252fa9f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/262738 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> (cherry picked from commit 11cfb48df192c14d185c1cfcaad1ba3e7b84c807) Reviewed-on: https://go-review.googlesource.com/c/go/+/264021
2020-10-20[release-branch.go1.14] runtime: stop preemption during syscall.Exec on DarwinIan Lance Taylor
On current macOS versions a program that receives a signal during an execve can fail with a SIGILL signal. This appears to be a macOS kernel bug. It has been reported to Apple. This CL partially works around the problem by using execLock to not send preemption signals during execve. Of course some other stray signal could occur, but at least we can avoid exacerbating the problem. We can't simply disable signals, as that would mean that the exec'ed process would start with all signals blocked, which it likely does not expect. For #41702 Fixes #41703 Change-Id: I91b0add967b315671ddcf73269c4d30136e579b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/262438 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> (cherry picked from commit 64fb6ae95f1c322486cbfb758552bb8439a8e6e8) Reviewed-on: https://go-review.googlesource.com/c/go/+/262737
2020-10-15[release-branch.go1.14] runtime: set g to gsignal before adjustSignalStackCherry Zhang
When a signal is received, the runtime probes whether an alternate signal stack is set, if so, adjust gsignal's stack to point to the alternate signal stack. This is done in adjustSignalStack, which calls sigaltstack "syscall", which is a libc call on darwin through asmcgocall. asmcgocall decides whether to do stack switch based on whether we're running on g0 stack, gsignal stack, or regular g stack. If g is not set to gsignal, asmcgocall may make wrong decision. Set g first. adjustSignalStack is recursively nosplit, so it is okay that temporarily gsignal.stack doesn't match the stack we're running on. Updates #39079. Fixes #41991. Change-Id: I59b2c5dc08c3c951f1098fff038bf2e06d7ca055 Reviewed-on: https://go-review.googlesource.com/c/go/+/238020 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit d286e61b6787fe2b55bf0ec8a814962ebda8d202) Reviewed-on: https://go-review.googlesource.com/c/go/+/262557 Trust: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
2020-10-14[release-branch.go1.14] go1.14.10go1.14.10Alexander Rakoczy
Change-Id: Ia983336cdedc9fa835bfc792dd1e819eef31596f Reviewed-on: https://go-review.googlesource.com/c/go/+/262338 Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Trust: Alexander Rakoczy <alex@golang.org>
2020-10-14[release-branch.go1.14] runtime: correct signature of call16Austin Clements
The signature of call16 is currently missing the "typ" parameter. This CL fixes this. This wasn't caught by vet because call16 is defined by macro expansion (see #17544), and we didn't notice the mismatch with the other call* functions because call16 is defined only on 32-bit architectures and lives alone in stubs32.go. Unfortunately, this means its GC signature is also wrong: the "arg" parameter is treated as a scalar rather than a pointer, so GC won't trace it and stack copying won't adjust it. This turns out to matter in exactly one case right now: on 32-bit architectures (which are the only architectures where call16 is defined), a stack-allocated defer of a function with a 16-byte or smaller argument frame including a non-empty result area can corrupt memory if the deferred function grows the stack and is invoked during a panic. Whew. All other current uses of reflectcall pass a heap-allocated "arg" frame (which happens to be reachable from other stack roots, so tracing isn't a problem). Curiously, in 2016, the signatures of all call* functions were wrong in exactly this way. CL 31654 fixed all of them in stubs.go, but missed the one in stubs32.go. Updates #41795. Fixes #41796. Change-Id: I31e3c0df201f79ee5707eeb8dc4ff0d13fc10ada Reviewed-on: https://go-review.googlesource.com/c/go/+/259338 Trust: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/259597
2020-10-08[release-branch.go1.14] database/sql: de-flake TestTxCannotCommitAfterRollbackDaniel Theophanes
Do not cancel rows during test. Only cancel the Tx. Correct the referenced issue number on the test. Updates #38597. Fixes #41815. Change-Id: I0e8ba1bf2a8ba638d121c9c6938501fec1d5e961 Reviewed-on: https://go-review.googlesource.com/c/go/+/229478 Run-TryBot: Daniel Theophanes <kardianos@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit ed7888aea6021e25b0ea58bcad3f26da2b139432) Reviewed-on: https://go-review.googlesource.com/c/go/+/259858 Trust: Dmitri Shuralyov <dmitshur@golang.org> Trust: Emmanuel Odeke <emm.odeke@gmail.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
2020-10-07[release-branch.go1.14] runtime: disable stack shrinking in activeStackChans ↵Michael Anthony Knyszek
race window Currently activeStackChans is set before a goroutine blocks on a channel operation in an unlockf passed to gopark. The trouble is that the unlockf is called *after* the G's status is changed, and the G's status is what is used by a concurrent mark worker (calling suspendG) to determine that a G has successfully been suspended. In this window between the status change and unlockf, the mark worker could try to shrink the G's stack, and in particular observe that activeStackChans is false. This observation will cause the mark worker to *not* synchronize with concurrent channel operations when it should, and so updating pointers in the sudog for the blocked goroutine (which may point to the goroutine's stack) races with channel operations which may also manipulate the pointer (read it, dereference it, update it, etc.). Fix the problem by adding a new atomically-updated flag to the g struct called parkingOnChan, which is non-zero in the race window above. Then, in isShrinkStackSafe, check if parkingOnChan is zero. The race is resolved like so: * Blocking G sets parkingOnChan, then changes status in gopark. * Mark worker successfully suspends blocking G. * If the mark worker observes parkingOnChan is non-zero when checking isShrinkStackSafe, then it's not safe to shrink (we're in the race window). * If the mark worker observes parkingOnChan as zero, then because the mark worker observed the G status change, it can be sure that gopark's unlockf completed, and gp.activeStackChans will be correct. The risk of this change is low, since although it reduces the number of places that stack shrinking is allowed, the window here is incredibly small. Essentially, every place that it might crash now is replaced with no shrink. This change adds a test, but the race window is so small that it's hard to trigger without a well-placed sleep in park_m. Also, this change fixes stackGrowRecursive in proc_test.go to actually allocate a 128-byte stack frame. It turns out the compiler was destructuring the "pad" field and only allocating one uint64 on the stack. For #40641. Fixes #40642. Change-Id: I7dfbe7d460f6972b8956116b137bc13bc24464e8 Reviewed-on: https://go-review.googlesource.com/c/go/+/247050 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com> Trust: Michael Knyszek <mknyszek@google.com> (cherry picked from commit eb3c6a93c3236bbde5dee6cc5bd4ca9f8ab1647a) Reviewed-on: https://go-review.googlesource.com/c/go/+/256301 Reviewed-by: Austin Clements <austin@google.com>
2020-10-05[release-branch.go1.14] cmd/compile: fix live variable computation for ↵Keith Randall
deferreturn Taking the live variable set from the last return point is problematic. See #40629 for details, but there may not be a return point, or it may be before the final defer. Additionally, keeping track of the last call as a *Value doesn't quite work. If it is dead-code eliminated, the storage for the Value is reused for some other random instruction. Its live variable information, if it is available at all, is wrong. Instead, just mark all the open-defer argument slots as live throughout the function. (They are already zero-initialized.) Fixes #40647 Change-Id: Ie456c7db3082d0de57eaa5234a0f32525a1cce13 Reviewed-on: https://go-review.googlesource.com/c/go/+/247522 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com> (cherry picked from commit 32a84c99e136ed5af0686dbedd31fd7dff40fb38) Reviewed-on: https://go-review.googlesource.com/c/go/+/248622 TryBot-Result: Go Bot <gobot@golang.org> Trust: Dmitri Shuralyov <dmitshur@golang.org>
2020-10-05[release-branch.go1.14] testing: flush test summaries to stdout atomically ↵Bryan C. Mills
when streaming output While debugging #40771, I realized that the chatty printer should only ever print to a single io.Writer (normally os.Stdout). The other Writer implementations in the chain write to local buffers, but if we wrote a test's output to a local buffer, then we did *not* write it to stdout and we should not store it as the most recently logged test. Because the chatty printer should only ever print to one place, it shouldn't receive an io.Writer as an argument — rather, it shouldn't be used at all for destinations other than the main output stream. On the other hand, when we flush the output buffer to stdout in the top-level flushToParent call, it is important that we not allow some other test's output to intrude between the test summary header and the remainder of the test's output. cmd/test2json doesn't know how to parse such an intrusion, and it's confusing to humans too. No test because I couldn't reproduce the user-reported error without modifying the testing package. (This behavior seems to be very sensitive to output size and/or goroutine scheduling.) Fixes #40880 Updates #40771 Updates #38458 Change-Id: Ic19bf1d535672b096ba1c8583a3b74aab6d6d766 Reviewed-on: https://go-review.googlesource.com/c/go/+/249026 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 51c0bdc6d15dcd7f753c25896039ab41ac787ebb) Reviewed-on: https://go-review.googlesource.com/c/go/+/252638 TryBot-Result: Go Bot <gobot@golang.org> Trust: Bryan C. Mills <bcmills@google.com>
2020-10-01[release-branch.go1.14] cmd/compile: prevent 387+float32+pie from clobbering ↵Keith Randall
registers The 387 port needs to load a floating-point control word from a global location to implement float32 arithmetic. When compiling with -pie, loading that control word clobbers an integer register. If that register had something important in it, boom. Fix by using LEAL to materialize the address of the global location first. LEAL with -pie works because the destination register is used as the scratch register. 387 support is about to go away (#40255), so this will need to be backported to have any effect. No test. I have one, but it requires building with -pie, which requires cgo. Our testing infrastructure doesn't make that easy. Not worth it for a port which is about to vanish. Fixes #41619 Change-Id: I140f9fc8fdce4e74a52c2c046e2bd30ae476d295 Reviewed-on: https://go-review.googlesource.com/c/go/+/257277 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Keith Randall <khr@golang.org> (cherry picked from commit ea106cc07ac73110a8a25fcc5aef07b283159db0) Reviewed-on: https://go-review.googlesource.com/c/go/+/257208
2020-09-10[release-branch.go1.14] runtime: fix ReadMemStatsSlow's and ↵Michael Anthony Knyszek
CheckScavengedBits' chunk iteration Both ReadMemStatsSlow and CheckScavengedBits iterate over the page allocator's chunks but don't actually check if they exist. During the development process the chunks index became sparse, so now this was a possibility. If the runtime tests' heap is sparse we might end up segfaulting in either one of these functions, though this will generally be very rare. The pattern here to return nil for a nonexistent chunk is also useful elsewhere, so this change introduces tryChunkOf which won't throw, but might return nil. It also updates the documentation of chunkOf. For #41296. Fixes #41322. Change-Id: Id5ae0ca3234480de1724fdf2e3677eeedcf76fa0 Reviewed-on: https://go-review.googlesource.com/c/go/+/253777 Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 34835df04891a1d54394888b763af88f9476101d) Reviewed-on: https://go-review.googlesource.com/c/go/+/253922 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2020-09-10[release-branch.go1.14] cmd/internal/obj: fix inline marker issue on s390xMichael Munday
The optimization that replaces inline markers with pre-existing instructions assumes that 'Prog' values produced by the compiler are still reachable after the assembler has run. This was not true on s390x where the assembler was removing NOP instructions from the linked list of 'Prog' values. This led to broken inlining data which in turn caused an infinite loop in the runtime traceback code. Fix this by stopping the s390x assembler backend removing NOP values. It does not make any difference to the output of the assembler because NOP instructions are 0 bytes long anyway. Note: compiler check omitted from backport to reduce risk of change. Fixes #40694. Change-Id: I9f9bdbe895c3478549b5e7e623f9521f841e926a Reviewed-on: https://go-review.googlesource.com/c/go/+/248477 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2020-09-09[release-branch.go1.14] go1.14.9go1.14.9Dmitri Shuralyov
Change-Id: I556ecd19f81692ddbd3faf1d918e36466833f12e Reviewed-on: https://go-review.googlesource.com/c/go/+/253737 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-09-03[release-branch.go1.14] cmd/compile, runtime: mark R12 clobbered for write ↵Cherry Zhang
barrier call on PPC64 When external linking, for large binaries, the external linker may insert a trampoline for the write barrier call, which looks 0000000005a98cc8 <__long_branch_runtime.gcWriteBarrier>: 5a98cc8: 86 01 82 3d addis r12,r2,390 5a98ccc: d8 bd 8c e9 ld r12,-16936(r12) 5a98cd0: a6 03 89 7d mtctr r12 5a98cd4: 20 04 80 4e bctr It clobbers R12 (and CTR, which is never live across a call). As at compile time we don't know whether the binary is big and what link mode will be used, I think we need to mark R12 as clobbered for write barrier call. For extra safety (future-proof) we mark caller-saved register that cannot be used for function arguments, which includes R11, as potentially clobbered as well. Updates #40851. Fixes #40938. Change-Id: Iedd901c5072f1127cc59b0a48cfeb4aaec81b519 Reviewed-on: https://go-review.googlesource.com/c/go/+/248917 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> (cherry picked from commit b58d29741650c7bf10b17f455666e2727e1cdd2e) Reviewed-on: https://go-review.googlesource.com/c/go/+/249697
2020-09-03[release-branch.go1.14] cmd/internal/obj: stop removing NOPs from ↵Keith Randall
instruction stream This has already been done for s390x, ppc64. This CL is for all the other architectures. Fixes #40797 Change-Id: Idd1816e057df63022d47e99fa06617811d8c8489 Reviewed-on: https://go-review.googlesource.com/c/go/+/248684 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com> (cherry picked from commit 46ca7b5ee2a8582736f1ddac27d8660e1104c345) Reviewed-on: https://go-review.googlesource.com/c/go/+/249443 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2020-09-03[release-branch.go1.14] cmd/internal/obj/ppc64: don't remove NOP in assemblerLynn Boger
Previously, the assembler removed NOPs from the Prog list in obj9.go. NOPs shouldn't be removed if they were added as an inline mark, as described in the issue below. Fixes #40766 Once the NOPs were left in the Prog list, some instructions were flagged as invalid because they had an operand which was not represented in optab. In order to preserve the previous assembler behavior, entries were added to optab for those operand cases. They were not flagged as errors before because the NOP instructions were removed before the code to check the valid opcode/operand combinations. Change-Id: Iae5145f94459027cf458e914d7c5d6089807ccf8 Reviewed-on: https://go-review.googlesource.com/c/go/+/247842 Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Paul Murphy <murp@ibm.com> Reviewed-by: Michael Munday <mike.munday@ibm.com> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit 7d7bd5abc7f7ac901830b79496f63ce86895e262) Reviewed-on: https://go-review.googlesource.com/c/go/+/248382 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2020-09-02[release-branch.go1.14] net/http/fgci: skip flaky testFilippo Valsorda
A test introduced in the security release is flaky due to a pre-existing issue that does not qualify for backport itself. Updates #41167 Fixes #41192 Change-Id: Ie6014e0796c1baee7b077881b5a799f9947fc9c2 Reviewed-on: https://go-review.googlesource.com/c/go/+/252718 Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>