aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-12[release-branch.go1.17] encoding/pem: fix stack overflow in DecodeJulie Qiu
Previously, Decode called decodeError, a recursive function that was prone to stack overflows when given a large PEM file containing errors. Credit to Juho Nurminen of Mattermost who reported the error. Fixes CVE-2022-24675 Updates #51853 Fixes #52036 Change-Id: Iffe768be53c8ddc0036fea0671d290f8f797692c Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1391157 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Filippo Valsorda <valsorda@google.com> (cherry picked from commit 794ea5e828010e8b68493b2fc6d2963263195a02) Reviewed-on: https://go-review.googlesource.com/c/go/+/399816 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-04-06[release-branch.go1.17] crypto/elliptic: tolerate zero-padded scalars in ↵Filippo Valsorda
generic P-256 Updates #52075 Fixes #52076 Fixes CVE-2022-28327 Change-Id: I595a7514c9a0aa1b9c76aedfc2307e1124271f27 Reviewed-on: https://go-review.googlesource.com/c/go/+/397136 Trust: Filippo Valsorda <filippo@golang.org> Reviewed-by: Julie Qiu <julie@golang.org>
2022-04-04[release-branch.go1.17] cmd/link: mark unexported methods for pluginsCherry Mui
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 #51736. Updates #51621. Change-Id: I1a70d3f96b66b803f2d0ab14d00ed0df276ea500 Reviewed-on: https://go-review.googlesource.com/c/go/+/393365 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> (cherry picked from commit 91631bc7e0131367eb051b581cf34573399ac592) Reviewed-on: https://go-review.googlesource.com/c/go/+/397484
2022-03-28[release-branch.go1.17] runtime: fix net poll racesRuss Cox
The netpoll code was written long ago, when the only multiprocessors that Go ran on were x86. It assumed that an atomic store would trigger a full memory barrier and then used that barrier to order otherwise racy access to a handful of fields, including pollDesc.closing. On ARM64, this code has finally failed, because the atomic store is on a value completely unrelated to any of the racily-accessed fields, and the ARMv8 hardware, unlike x86, is clever enough not to do a full memory barrier for a simple atomic store. We are seeing a constant background rate of trybot failures where the net/http tests deadlock - a netpollblock has clearly happened after the pollDesc has begun to close. The code that does the racy reads is netpollcheckerr, which needs to be able to run without acquiring a lock. This CL fixes the race, without introducing unnecessary inefficiency or deadlock, by arranging for every updater of the relevant fields to publish a summary as a single atomic uint32, and then having netpollcheckerr use a single atomic load to fetch the relevant bits and then proceed as before. For #45211 Fixes #50611 Change-Id: Ib6788c8da4d00b7bda84d55ca3fdffb5a64c1a0a Reviewed-on: https://go-review.googlesource.com/c/go/+/378234 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Trust: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 17b2fb1b656a275906b5071c562439d50a27f167) Reviewed-on: https://go-review.googlesource.com/c/go/+/392714 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2022-03-28[release-branch.go1.17] runtime: call testenv.MustHaveCGO in a couple of testsIan Lance Taylor
For #51695 Fixes #51696 Change-Id: Icfe9d26ecc28a7db9040d50d4661cf9e8245471e Reviewed-on: https://go-review.googlesource.com/c/go/+/392916 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> (cherry picked from commit 2d32594396b231b39d09ec21d34b22b0270268b5) Reviewed-on: https://go-review.googlesource.com/c/go/+/393698 Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2022-03-14[release-branch.go1.17] runtime: count spill slot for frame size at ↵Cherry Mui
finalizer call The finalizer is called using reflectcall. When register ABI is used, the finalizer's argument is passed in register(s). But the frame size calculation does not include the spill slot. When the argument actually spills, it may clobber the caller's stack frame. This CL fixes it. Updates #51457. Fixes #51458. Change-Id: Ibcc7507c518ba65c1c5a7759e5cab0ae3fc7efce Reviewed-on: https://go-review.googlesource.com/c/go/+/389574 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> (cherry picked from commit 58804ea67a28c1d8e37ed548b685bc0c09638886) Reviewed-on: https://go-review.googlesource.com/c/go/+/389794
2022-03-07[dev.boringcrypto.go1.17] all: merge go1.17.8 into dev.boringcrypto.go1.17Carlos Amedee
Change-Id: I093903982eb185a2c36b85656c4009ce75d951e3
2022-03-03[release-branch.go1.17] go1.17.8go1.17.8Carlos Amedee
Change-Id: I14f4da429cf8562c6cab99cd0cd4edfbc03f68e9 Reviewed-on: https://go-review.googlesource.com/c/go/+/389736 Trust: Carlos Amedee <carlos@golang.org> Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alex Rakoczy <alex@golang.org>
2022-03-03[release-branch.go1.17] cmd/go: avoid +incompatible major versions if a ↵Bryan C. Mills
go.mod file exists in a subdirectory for that version Previous versions of the 'go' command would reject a pseudo-version passed to 'go get' if that pseudo-version had a mismatched major version and lacked a "+incompatible" suffix. However, they would erroneously accept a version *with* a "+incompatible" suffix even if the repo contained a vN/go.mod file for the same major version, and would generate a "+incompatible" pseudo-version or version if the user requested a tag, branch, or commit hash. This change uniformly rejects "vN.…" without "+incompatible", and also avoids resolving to "vN.…+incompatible", when vN/go.mod exists. To maintain compatibility with existing go.mod files, it still accepts "vN.…+incompatible" if the version is requested explicitly as such and the repo root lacks a go.mod file. Fixes #51332 Updates #51324 Updates #36438 Change-Id: I2b16150c73fc2abe4d0a1cd34cb1600635db7139 Reviewed-on: https://go-review.googlesource.com/c/go/+/387675 Trust: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> (cherry picked from commit 5a9fc946b42cc987db41eabcfcbaffd2fb310d94) Reviewed-on: https://go-review.googlesource.com/c/go/+/387922 Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-02-18[release-branch.go1.17] cmd/compile: correct type of pointer difference on ↵Cherry Mui
RISCV64 Pointer comparison is lowered to the following on RISCV64 (EqPtr x y) => (SEQZ (SUB <x.Type> x y)) The difference of two pointers (the SUB) should not be pointer type. Otherwise it can cause the GC to find a bad pointer. Updates #51101. Fixes #51199. Change-Id: I7e73c2155c36ff403c032981a9aa9cccbfdf0f64 Reviewed-on: https://go-review.googlesource.com/c/go/+/385655 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 1ed30ca537a05b887f8479027b6363a03f957610) Reviewed-on: https://go-review.googlesource.com/c/go/+/386474
2022-02-18[release-branch.go1.17] runtime: simplify histogram buckets considerablyMichael Anthony Knyszek
There was an off-by-one error in the time histogram buckets calculation that caused the linear sub-buckets distances to be off by 2x. The fix was trivial, but in writing tests I realized there was a much simpler way to express the calculation for the histogram buckets, and took the opportunity to do that here. The new bucket calculation also fixes the bug. For #50732. Fixes #50734. Change-Id: Idae89986de1c415ee4e148f778e0e101ca003ade Reviewed-on: https://go-review.googlesource.com/c/go/+/380094 Reviewed-by: Michael Pratt <mpratt@google.com> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> (cherry picked from commit 2e9dcb508647dc473a37ecfa244d2bc4a1843ab4) Reviewed-on: https://go-review.googlesource.com/c/go/+/384621 TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-17[release-branch.go1.17] net: increase maximum accepted DNS packet to 1232 bytesIan Lance Taylor
The existing value of 512 bytes as is specified by RFC 1035. However, the WSL resolver reportedly sends larger packets without setting the truncation bit, which breaks using the Go resolver. For 1.18 and backports, just increase the accepted packet size. This is what GNU glibc does (they use 65536 bytes). For 1.19 we plan to use EDNS to set the accepted packet size. That will give us more time to test whether that causes any problems. No test because I'm not sure how to write one and it wouldn't really be useful anyhow. For #6464 For #21160 For #44135 For #51127 For #51153 Fixes #51162 Change-Id: I0243f274a06e010ebb714e138a65386086aecf17 Reviewed-on: https://go-review.googlesource.com/c/go/+/386015 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 6e82ff83cfbef78aa60706c1a7167a31c30e7ef9) Reviewed-on: https://go-review.googlesource.com/c/go/+/386035 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2022-02-17[release-branch.go1.17] regexp/syntax: reject very deeply nested regexps in ↵Russ Cox
Parse The regexp code assumes it can recurse over the structure of a regexp safely. Go's growable stacks make that reasonable for all plausible regexps, but implausible ones can reach the “infinite recursion?” stack limit. This CL limits the depth of any parsed regexp to 1000. That is, the depth of the parse tree is required to be ≤ 1000. Regexps that require deeper parse trees will return ErrInternalError. A future CL will change the error to ErrInvalidDepth, but using ErrInternalError for now avoids introducing new API in point releases when this is backported. Fixes #51112. Fixes #51118. Change-Id: I97d2cd82195946eb43a4ea8561f5b95f91fb14c5 Reviewed-on: https://go-review.googlesource.com/c/go/+/384616 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/384854 TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-14[dev.boringcrypto.go1.17] misc/boring: use go install cmd@latest for ↵Cherry Mui
installing command "go get cmd" is deprecated. Change-Id: I2242764c79b5e4c3ff94e5323d6504b596bdc9e2 Reviewed-on: https://go-review.googlesource.com/c/go/+/385197 Trust: Cherry Mui <cherryyz@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 8521d1ea346212bcdabe15b4e157b3a2f2ca95f4) Reviewed-on: https://go-review.googlesource.com/c/go/+/385234
2022-02-11[dev.boringcrypto.go1.17] all: merge go1.17.7 into dev.boringcrypto.go1.17Cherry Mui
Change-Id: I6abebb215a38b5df450ef12281266bef6c8e76eb
2022-02-09[release-branch.go1.17] crypto/x509: support NumericString in DN componentsRoland Shoemaker
Updates #48171 Fixes #51000 Change-Id: Ia2e1920c0938a1f8659935a4f725a7e5090ef2c0 Reviewed-on: https://go-review.googlesource.com/c/go/+/347034 Trust: Roland Shoemaker <roland@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> (cherry picked from commit 896df422a7cecbace10f5877beeeb1476b6061ae) Reviewed-on: https://go-review.googlesource.com/c/go/+/382857 Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2022-02-09[release-branch.go1.17] go1.17.7go1.17.7Cherry Mui
Change-Id: I760af1114e06bf408715e094d8d5b66c5aeb3e16 Reviewed-on: https://go-review.googlesource.com/c/go/+/384494 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alex Rakoczy <alex@golang.org>
2022-02-07[release-branch.go1.17] runtime: set vdsoSP to caller's SP consistentlyCherry Mui
m.vdsoSP should be set to the SP of the caller of nanotime1, instead of the SP of nanotime1 itself, which matches m.vdsoPC. Otherwise the unmatched vdsoPC and vdsoSP would make the stack trace look like recursive. We already do it correctly on AMD64, 386, and RISCV64. This CL fixes the rest. Also incorporate CL 352509, skipping a flaky test. Updates #47324, #50772. Fixes #50781. Change-Id: I98b6fcfbe9fc6bdd28b8fe2a1299b7c505371dd4 Reviewed-on: https://go-review.googlesource.com/c/go/+/337590 Trust: Cherry Mui <cherryyz@google.com> Trust: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com> (cherry picked from commit 217507eb035933bac6c990844f0d71d6000fd339) Reviewed-on: https://go-review.googlesource.com/c/go/+/380715 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-02-07[release-branch.go1.17] cmd/link: force eager binding when using plugins on ↵Cherry Mui
darwin When building/using plugins on darwin, we need to use flat namespace so the same symbol from the main executable and the plugin can be resolved to the same address. Apparently, when using flat namespace the dynamic linker can hang at forkExec when resolving a lazy binding. Work around it by forcing early bindings. Updates #38824. Fixes #50246. Change-Id: I983aa0a0960b15bf3f7871382e8231ee244655f4 Reviewed-on: https://go-review.googlesource.com/c/go/+/372798 Trust: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit c5fee935bbb8f02406eb653cfed550593755a1a4) Reviewed-on: https://go-review.googlesource.com/c/go/+/373094
2022-02-07[release-branch.go1.17] crypto/elliptic: make IsOnCurve return false for ↵Filippo Valsorda
invalid field elements Updates #50974 Fixes #50978 Fixes CVE-2022-23806 Change-Id: I0201c2c88f13dd82910985a495973f1683af9259 Reviewed-on: https://go-review.googlesource.com/c/go/+/382854 Trust: Filippo Valsorda <filippo@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Katie Hockman <katie@golang.org> Trust: Katie Hockman <katie@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-07[release-branch.go1.17] cmd/go/internal/modfetch: do not short-circuit ↵Bryan C. Mills
canonical versions Since at least CL 121857, the conversion logic in (*modfetch).codeRepo.Stat has had a short-circuit to use the version requested by the caller if it successfully resolves and is already canonical. However, we should not use that version if it refers to a branch instead of a tag, because branches (unlike tags) usually do not refer to a single, stable release: a branch named "v1.0.0" may be for the development of the v1.0.0 release, or for the development of patches based on v1.0.0, but only one commit (perhaps at the end of that branch — but possibly not even written yet!) can be that specific version. We already have some logic to prefer tags that are semver-equivalent to the version requested by the caller. That more general case suffices for exact equality too — so we can eliminate the special-case, fixing the bug and (happily!) also somewhat simplifying the code. Updates #35671 Fixes #50687 Fixes CVE-2022-23773 Change-Id: I2fd290190b8a99a580deec7e26d15659b58a50b0 Reviewed-on: https://go-review.googlesource.com/c/go/+/378400 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit fa4d9b8e2bc2612960c80474fca83a4c85a974eb) Reviewed-on: https://go-review.googlesource.com/c/go/+/382835
2022-02-07[release-branch.go1.17] cmd/compile: remove incorrect arm,arm64 CMP->CMN ↵David Chase
transformations These can go wrong when one of the operands is the minimum integer value. Fixes #50867. Change-Id: I238fe284f60c7ee5aeb9dc9a18e8b1578cdb77d0 Reviewed-on: https://go-review.googlesource.com/c/go/+/381318 Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Trust: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit b7b44b3173f151a2313da7072afd25de80511605) Reviewed-on: https://go-review.googlesource.com/c/go/+/381474 Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-02-07[release-branch.go1.17] cmd/compile: don't elide extension for LoadReg to FP ↵Cherry Mui
register on MIPS64 For an extension operation like MOVWreg, if the operand is already extended, we optimize the second extension out. Usually a LoadReg of a proper type would come already extended, as a MOVW/MOVWU etc. instruction does. But for a LoadReg to a floating point register, the instruction does not do the extension. So we cannot elide the extension. Updates #50671. Fixes #50683. Change-Id: Id8991df78d5acdecd3fd6138c558428cbd5f6ba3 Reviewed-on: https://go-review.googlesource.com/c/go/+/379236 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> (cherry picked from commit d93ff73ae207763871bee38590242be968b2e743) Reviewed-on: https://go-review.googlesource.com/c/go/+/379514
2022-02-07[release-branch.go1.17] cmd/internal/obj/x86: modify the threshold of assert ↵zhouguangyuan
loop for span6 Updates #49716. Fixes #50942. Change-Id: I7ed73f874c2ee1ee3f31c9c4428ed484167ca803 Reviewed-on: https://go-review.googlesource.com/c/go/+/366094 Reviewed-by: Cherry Mui <cherryyz@google.com> Trust: Heschi Kreinick <heschi@google.com> (cherry picked from commit 14f2b2a4c55b707828be2890b8c750cb849203f6) Reviewed-on: https://go-review.googlesource.com/c/go/+/383214 Trust: Cherry Mui <cherryyz@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alex Rakoczy <alex@golang.org>
2022-02-07[release-branch.go1.17] cmd/go: remove mercurial from bitbucket vcs optionsEthan Anderson
Mercurial was deprecated as of July 1, 2020 as per https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket Fixes #50812. Updates #50810. Change-Id: I0d40f84aaa393905cae7c4bed8919b15de9a5f6d Reviewed-on: https://go-review.googlesource.com/c/go/+/371720 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Trust: Bryan Mills <bcmills@google.com> (cherry picked from commit 5b1b80beb1a2a9a353738e80777d1e25cfdfa095) Reviewed-on: https://go-review.googlesource.com/c/go/+/380996 Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2022-02-03[release-branch.go1.17] debug/pe,debug/macho: add support for DWARF5 sectionsAlessandro Arzilli
Adds the same logic used in debug/elf to load DWARF5 sections. For #49590 Fixes #50722 Change-Id: Iee05b9927a6f521842b330eab8942ade3fc2bd86 Reviewed-on: https://go-review.googlesource.com/c/go/+/363895 Reviewed-by: Ian Lance Taylor <iant@golang.org> Trust: Than McIntosh <thanm@google.com> (cherry picked from commit 6c36c332fefdd433cfe6e6468a2542fc310e9f8a) Reviewed-on: https://go-review.googlesource.com/c/go/+/379914 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
2022-01-28[release-branch.go1.17] math/big: prevent overflow in (*Rat).SetStringKatie Hockman
Credit to rsc@ for the original patch. Thanks to the OSS-Fuzz project for discovering this issue and to Emmanuel Odeke (@odeke_et) for reporting it. Updates #50699 Fixes #50701 Fixes CVE-2022-23772 Change-Id: I590395a3d55689625390cf1e58f5f40623b26ee5 Reviewed-on: https://go-review.googlesource.com/c/go/+/379537 Trust: Katie Hockman <katie@golang.org> Run-TryBot: Katie Hockman <katie@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Julie Qiu <julie@golang.org> (cherry picked from commit ad345c265916bbf6c646865e4642eafce6d39e78) Reviewed-on: https://go-review.googlesource.com/c/go/+/381336 Reviewed-by: Filippo Valsorda <filippo@golang.org>
2022-01-27[release-branch.go1.17] net/http/internal/testcert: use FIPS-compliant ↵Damien Neil
certificate Upgrade the test certificate from RSA 1024 (not FIPS-approved) to RSA 2048 (FIPS-approved), allowing tests to pass when the dev.boringcrypto branch FIPS-only mode is enabled. For #48674. Fixes #50586. Change-Id: I613d2f8d0207bf3683fd0df256bf0167604996c5 Reviewed-on: https://go-review.googlesource.com/c/go/+/353869 Trust: Damien Neil <dneil@google.com> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org> (cherry picked from commit 90860e0c3110ac5898dfe8e0e0fafd0aea8d979a) Reviewed-on: https://go-review.googlesource.com/c/go/+/380995 Trust: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-01-14[dev.boringcrypto.go1.17] all: merge go1.17.6 into dev.boringcrypto.go1.17David Chase
Change-Id: I0c3186c3d56c585934efc7f47eb78c7ac10a7c37
2022-01-06[release-branch.go1.17] go1.17.6go1.17.6Carlos Amedee
Change-Id: I66a51a8fb3405395c066db37195e7e2a5c44a2d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/375975 Trust: Carlos Amedee <carlos@golang.org> Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2022-01-06[release-branch.go1.17] net/http: update bundled golang.org/x/net/http2Carlos Amedee
Pull in approved backports to golang.org/x/net/http2: 21a9c9c http2: prioritize RST_STREAM frames in random write scheduler By doing: $ go get -d golang.org/x/net@internal-branch.go1.17-vendor $ go mod tidy $ go mod vendor $ go generate -run=bundle std Fixes #49921 Change-Id: I04739a30d84a8ae449374eca8bb11c7d2d215ad9 Reviewed-on: https://go-review.googlesource.com/c/go/+/375814 Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Trust: Carlos Amedee <carlos@golang.org>
2022-01-05[release-branch.go1.17] cmd/link: use SHT_INIT_ARRAY for .init_array sectionIan Lance Taylor
For #50295 Fixes #50297 Change-Id: If55ebcd5f2af724da7c9c744458a56d21a7ddde7 Reviewed-on: https://go-review.googlesource.com/c/go/+/373734 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> (cherry picked from commit cfb0cc355233d4367b188b23a3bc143985a28b8c) Reviewed-on: https://go-review.googlesource.com/c/go/+/374194 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-22[release-branch.go1.17] runtime: set iOS addr space to 40 bits with ↵Michael Anthony Knyszek
incremental pagealloc In iOS <14, the address space is strictly limited to 8 GiB, or 33 bits. As a result, the page allocator also assumes all heap memory lives in this region. This is especially necessary because the page allocator has a PROT_NONE mapping proportional to the size of the usable address space, so this keeps that mapping very small. However starting with iOS 14, this restriction is relaxed, and mmap may start returning addresses outside of the <14 range. Today this means that in iOS 14 and later, users experience an error in the page allocator when a heap arena is mapped outside of the old range. This change increases the ios/arm64 heapAddrBits to 40 while simultaneously making ios/arm64 use the 64-bit pagealloc implementation (with reservations and incremental mapping) to accommodate both iOS versions <14 and 14+. Once iOS <14 is deprecated, we can remove these exceptions and treat ios/arm64 like any other arm64 platform. This change also makes the BaseChunkIdx expression a little bit easier to read, while we're here. For #46860. Fixes #48116. Change-Id: I13865f799777739109585f14f1cc49d6d57e096b Reviewed-on: https://go-review.googlesource.com/c/go/+/344401 Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Austin Clements <austin@google.com> (cherry picked from commit af368da0b137116faba81ca249a8d964297e6e45) Reviewed-on: https://go-review.googlesource.com/c/go/+/369737
2021-12-22[release-branch.go1.17] runtime/race: rebuild darwin syso to work around ↵Cherry Mui
macOS 12 malloc reserved address On macOS 12 a new malloc implementation (nano) is used by default, and apparently it reserves address range 0x600000000000-0x600020000000, which conflicts with the address range that TSAN uses for Go. Work around the issue by changing the address range slightly. The actual change is made on LLVM at https://reviews.llvm.org/D114825 . This CL includes syso's built with the patch applied. The syso in 1.17 was identical to the syso before the equivalent fix on the main branch, so the back-ported syso is identical to the fixed syso on the main branch. Fixes #50073. Updates #49138. Change-Id: I7b367d6e042b0db39a691c71601c98e4f8728a70 Reviewed-on: https://go-review.googlesource.com/c/go/+/367916 Trust: Cherry Mui <cherryyz@google.com> Reviewed-by: Austin Clements <austin@google.com> (cherry picked from commit 5f6552018d1ec920c3ca3d459691528f48363c3c) Reviewed-on: https://go-review.googlesource.com/c/go/+/370697
2021-12-21[release-branch.go1.17] cmd/compile: avoid adding LECall to the entry block ↵hanpro
when has opendefers The openDeferRecord always insert vardef/varlive pairs into the entry block, it may destroy the mem chain when LECall's args are writing into the same block. So create a new block before that happens. Fixes #49413 Change-Id: Ibda6c4a45d960dd412a641f5e02276f663c80785 Reviewed-on: https://go-review.googlesource.com/c/go/+/361410 Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Alberto Donizetti <alb.donizetti@gmail.com> Trust: Than McIntosh <thanm@google.com> Reviewed-by: David Chase <drchase@google.com> (cherry picked from commit 4f083c7dcf6ace3e837b337e10cf2f4e3160677e) Reviewed-on: https://go-review.googlesource.com/c/go/+/362054 Reviewed-by: Keith Randall <khr@golang.org> Trust: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-21[release-branch.go1.17] reflect: keep pointer in aggregate-typed args live ↵Keith Randall
in Call When register ABI is used, reflect.Value.Call prepares the call arguments in a memory representation of the argument registers. It has special handling to keep the pointers in arguments live. Currently, this handles pointer-typed arguments. But when an argument is an aggregate-type that contains pointers and passed in registers, it currently doesn't keep the pointers live. Do so in this CL. Fixes #49961 Change-Id: I9264a8767e2a2c48573f6047144759b845dcf480 Reviewed-on: https://go-review.googlesource.com/c/go/+/369098 Trust: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2021-12-21[release-branch.go1.17] all: update vendored golang.org/x/crypto for ↵Filippo Valsorda
cryptobyte fix Updates #49678 Fixes #50165 Change-Id: I47dd959a787180a67856e60dfa6eba3ddd045972 Reviewed-on: https://go-review.googlesource.com/c/go/+/373361 Trust: Filippo Valsorda <filippo@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com> Reviewed-by: Julie Qiu <julie@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-09[dev.boringcrypto.go1.17] all: merge go1.17.5 into dev.boringcrypto.go1.17Alexander Rakoczy
Change-Id: I7a13ae198c11b3501eee580970f40981249f2386
2021-12-09[release-branch.go1.17] go1.17.5go1.17.5Alexander Rakoczy
Change-Id: Ief6fb9e836c1d40ece56868d65ebf65f74e65665 Reviewed-on: https://go-review.googlesource.com/c/go/+/370555 Trust: Alex Rakoczy <alex@golang.org> Run-TryBot: Alex Rakoczy <alex@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-09[release-branch.go1.17] net/http: update bundled golang.org/x/net/http2Filippo Valsorda
Pull in security fix 84cba54 http2: cap the size of the server's canonical header cache Updates #50058 Fixes CVE-2021-44716 Change-Id: Ia89e3d22a173c6cb83f03608d5186fcd08f2956c Reviewed-on: https://go-review.googlesource.com/c/go/+/370574 Trust: Filippo Valsorda <filippo@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Alex Rakoczy <alex@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-09[release-branch.go1.17] syscall: avoid writing to p when Pipe(p) failsRuss Cox
Generally speaking Go functions make no guarantees about what has happened to result parameters on error, and Pipe is no exception: callers should avoid looking at p if Pipe returns an error. However, we had a bug in which ForkExec was using the content of p after a failed Pipe, and others may too. As a robustness fix, make Pipe avoid writing to p on failure. Updates #50057 Change-Id: Ie8955025dbd20702fabadc9bbe1d1a5ac0f36305 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1291271 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/370535 Trust: Filippo Valsorda <filippo@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Alex Rakoczy <alex@golang.org>
2021-12-09[release-branch.go1.17] syscall: fix ForkLock spurious close(0) on pipe failureRuss Cox
Pipe (and therefore forkLockPipe) does not make any guarantees about the state of p after a failed Pipe(p). Avoid that assumption and the too-clever goto, so that we don't accidentally Close a real fd if the failed pipe leaves p[0] or p[1] set >= 0. Updates #50057 Fixes CVE-2021-44717 Change-Id: Iff8e19a6efbba0c73cc8b13ecfae381c87600bb4 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1291270 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/370534 Trust: Filippo Valsorda <filippo@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alex Rakoczy <alex@golang.org>
2021-12-06[release-branch.go1.17] misc/cgo/testplugin: skip TestIssue25756pie on ↵Heschi Kreinick
darwin/arm64 builder Repeat of CL 321349 for macOS 12. We won't need to do this again -- the test is passing at tip. Updates #46239. Change-Id: Ib279ada443ee03eb8e70fde4bbfba65ce0f6322e Reviewed-on: https://go-review.googlesource.com/c/go/+/369748 Trust: Heschi Kreinick <heschi@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2021-12-03[dev.boringcrypto.go1.17] all: merge go1.17.4 into dev.boringcrypto.go1.17Michael Anthony Knyszek
Change-Id: I1fdbced0ec670a133ced9702c24266dcadc47faf
2021-12-02[release-branch.go1.17] go1.17.4go1.17.4Heschi Kreinick
Change-Id: I11748377b7a35bd38b52e6f81093cc210f6d2857 Reviewed-on: https://go-review.googlesource.com/c/go/+/368695 Trust: Heschi Kreinick <heschi@google.com> Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Heschi Kreinick <heschi@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
2021-12-02[release-branch.go1.17] cmd/compile: only update source type when processing ↵Cuong Manh Le
struct/array This is backport of CL 3651594, with the test from CL 360057. CL 360057 fixed missing update source type in storeArgOrLoad. However, we should only update the type when processing struct/array. If we update the type right before calling storeArgOrLoad, we may generate a value with invalid type, e.g, OpStructSelect with non-struct type. Fixes #49392 Change-Id: Ib7e10f72f818880f550aae5c9f653db463ce29b0 Reviewed-on: https://go-review.googlesource.com/c/go/+/361594 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/361596 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org>
2021-12-02[release-branch.go1.17] net/http: update bundled golang.org/x/net/http2Michael Anthony Knyszek
Pull in approved backports to golang.org/x/net/http2: 85e122b net/http2: Fix handling of expect continue 1dc0aec http2: don't count aborted streams as active in tests e973a42 ipv6: OpenBSD does not appear to support multicast loopback 9592dd5 http2: avoid busy loop when ResponseHeaderTimeout is set 94fb2bc http2: avoid spurious RoundTrip error when server closes and resets stream e108c19 http2: close conns after use when req.Close is set By doing: $ go get -d golang.org/x/net@internal-branch.go1.17-vendor go: upgraded golang.org/x/net v0.0.0-20211101194204-95aca89e93de => v0.0.0-20211201233630-85e122b1a9b3 $ go mod tidy $ go mod vendor $ go generate -run=bundle std Fixes #49561. Fixes #49624. Fixes #49662. Fixes #49905. Fixes #49909. Fixes #49911. Change-Id: Ia8f432bd3ea77d24e63d46c8ed2ac8d275406b52 Reviewed-on: https://go-review.googlesource.com/c/go/+/368574 Trust: Michael Knyszek <mknyszek@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2021-12-01[release-branch.go1.17] go/types: break cycles in invalid typesRobert Griesemer
This is a partial port of CL 354329 from types2 to go/types. It contains an adjustment to type.go to deal with possibly invalid type bounds. Fixes #48825. For #48819. Change-Id: I9efdcdbfa6432f3cee64d924a4c67ecc6793cf86 Reviewed-on: https://go-review.googlesource.com/c/go/+/354349 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/368456 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
2021-12-01[release-branch.go1.17] net/http: do not send Transfer-Encoding: identity in ↵Damien Neil
responses Server handlers may set a "Transfer-Encoding: identity" header on responses to disable chunking, but this header should not be sent on the wire. For #49194. Fixes #49568. Change-Id: I46a9e3b8ff9d93edd7d1c34d264fc309fa322ad5 Reviewed-on: https://go-review.googlesource.com/c/go/+/359176 Trust: Damien Neil <dneil@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit b69b2f63d65609b400b4a40ae01e4a48638f050f) Reviewed-on: https://go-review.googlesource.com/c/go/+/368087 Reviewed-by: Michael Knyszek <mknyszek@google.com>
2021-12-01[release-branch.go1.17] net/http: do not cancel request context on response ↵Damien Neil
body read When sending a Request with a non-context deadline, we create a context with a timeout. This context is canceled when closing the response body, and also if a read from the response body returns an error (including io.EOF). Cancelling the context in Response.Body.Read interferes with the HTTP/2 client cleaning up after a request is completed, and is unnecessary: The user should always close the body, the impact from not canceling the context is minor (the context timer leaks until it fires). Fixes #49559. For #49366. Change-Id: Ieaed866116916261d9079f71d8fea7a7b303b8fb Reviewed-on: https://go-review.googlesource.com/c/go/+/361919 Trust: Damien Neil <dneil@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 76fbd6167364fb98e3ebe946cfc16b5b84d4240e) Reviewed-on: https://go-review.googlesource.com/c/go/+/368085 Reviewed-by: Michael Knyszek <mknyszek@google.com>