summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [release-branch.go1.19] go1.19.6go1.19.6Gopher Robot2023-02-141-1/+1
| | | | | | | | | | Change-Id: Iaafff862e746e7c81a6df9ca9b7b6179efe1172e Reviewed-on: https://go-review.googlesource.com/c/go/+/468237 Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Auto-Submit: Gopher Robot <gobot@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
* [release-branch.go1.19] net/http: update bundled golang.org/x/net/http2Roland Shoemaker2023-02-142-31/+50
| | | | | | | | | | | | | | | | | | | | | Disable cmd/internal/moddeps test, since this update includes PRIVATE track fixes. Fixes CVE-2022-41723 Fixes #58355 Updates #57855 Change-Id: Ie870562a6f6e44e4e8f57db6a0dde1a41a2b090c Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1728939 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Julie Qiu <julieqiu@google.com> Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Run-TryBot: Roland Shoemaker <bracewell@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/468118 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
* [release-branch.go1.19] crypto/tls: replace all usages of BytesOrPanicRoland Shoemaker2023-02-1413-503/+657
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Message marshalling makes use of BytesOrPanic a lot, under the assumption that it will never panic. This assumption was incorrect, and specifically crafted handshakes could trigger panics. Rather than just surgically replacing the usages of BytesOrPanic in paths that could panic, replace all usages of it with proper error returns in case there are other ways of triggering panics which we didn't find. In one specific case, the tree routed by expandLabel, we replace the usage of BytesOrPanic, but retain a panic. This function already explicitly panicked elsewhere, and returning an error from it becomes rather painful because it requires changing a large number of APIs. The marshalling is unlikely to ever panic, as the inputs are all either fixed length, or already limited to the sizes required. If it were to panic, it'd likely only be during development. A close inspection shows no paths for a user to cause a panic currently. This patches ends up being rather large, since it requires routing errors back through functions which previously had no error returns. Where possible I've tried to use helpers that reduce the verbosity of frequently repeated stanzas, and to make the diffs as minimal as possible. Thanks to Marten Seemann for reporting this issue. Updates #58001 Fixes #58358 Fixes CVE-2022-41724 Change-Id: Ieb55867ef0a3e1e867b33f09421932510cb58851 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1679436 Reviewed-by: Julie Qiu <julieqiu@google.com> TryBot-Result: Security TryBots <security-trybots@go-security-trybots.iam.gserviceaccount.com> Run-TryBot: Roland Shoemaker <bracewell@google.com> Reviewed-by: Damien Neil <dneil@google.com> (cherry picked from commit 0f3a44ad7b41cc89efdfad25278953e17d9c1e04) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1728204 Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/468117 Auto-Submit: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
* [release-branch.go1.19] mime/multipart: limit memory/inode consumption of ↵Damien Neil2023-02-146-38/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ReadForm Reader.ReadForm is documented as storing "up to maxMemory bytes + 10MB" in memory. Parsed forms can consume substantially more memory than this limit, since ReadForm does not account for map entry overhead and MIME headers. In addition, while the amount of disk memory consumed by ReadForm can be constrained by limiting the size of the parsed input, ReadForm will create one temporary file per form part stored on disk, potentially consuming a large number of inodes. Update ReadForm's memory accounting to include part names, MIME headers, and map entry overhead. Update ReadForm to store all on-disk file parts in a single temporary file. Files returned by FileHeader.Open are documented as having a concrete type of *os.File when a file is stored on disk. The change to use a single temporary file for all parts means that this is no longer the case when a form contains more than a single file part stored on disk. The previous behavior of storing each file part in a separate disk file may be reenabled with GODEBUG=multipartfiles=distinct. Update Reader.NextPart and Reader.NextRawPart to set a 10MiB cap on the size of MIME headers. Thanks to Jakob Ackermann (@das7pad) for reporting this issue. Updates #58006 Fixes #58362 Fixes CVE-2022-41725 Change-Id: Ibd780a6c4c83ac8bcfd3cbe344f042e9940f2eab Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1714276 Reviewed-by: Julie Qiu <julieqiu@google.com> TryBot-Result: Security TryBots <security-trybots@go-security-trybots.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <bracewell@google.com> Run-TryBot: Damien Neil <dneil@google.com> (cherry picked from commit ed4664330edcd91b24914c9371c377c132dbce8c) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1728949 Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Run-TryBot: Roland Shoemaker <bracewell@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/468116 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com>
* [release-branch.go1.19] path/filepath: do not Clean("a/../c:/b") into c:\b ↵Damien Neil2023-02-143-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on Windows Do not permit Clean to convert a relative path into one starting with a drive reference. This change causes Clean to insert a . path element at the start of a path when the original path does not start with a volume name, and the first path element would contain a colon. This may introduce a spurious but harmless . path element under some circumstances. For example, Clean("a/../b:/../c") becomes `.\c`. This reverts CL 401595, since the change here supersedes the one in that CL. Thanks to RyotaK (https://twitter.com/ryotkak) for reporting this issue. Updates #57274 Fixes #57275 Fixes CVE-2022-41722 Change-Id: I837446285a03aa74c79d7642720e01f354c2ca17 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1675249 Reviewed-by: Roland Shoemaker <bracewell@google.com> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Julie Qiu <julieqiu@google.com> TryBot-Result: Security TryBots <security-trybots@go-security-trybots.iam.gserviceaccount.com> (cherry picked from commit 780dfa043ff5192c37de0d6fd1053a66b2b9f378) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1728206 Reviewed-by: Damien Neil <dneil@google.com> Run-TryBot: Roland Shoemaker <bracewell@google.com> Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/468115 Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> Auto-Submit: Michael Pratt <mpratt@google.com> TryBot-Bypass: Michael Pratt <mpratt@google.com>
* [release-branch.go1.19] cmd/link: keep go.buildinfo even with --gc-sectionsRuss Cox2023-02-102-1/+36
| | | | | | | | | | | | | | | | | | | | | | If you use an external linker with --gc-sections, nothing refers to .go.buildinfo, so the section is deleted, which in turns makes 'go version' fail on the binary. It is important for vulnerability scanning and the like to be able to run 'go version' on any binary. Fix this by inserting a reference to .go.buildinfo from the rodata section, which will not be GC'ed. Fixes #58222. Fixes #58223. Change-Id: I1e13e9464acaf2f5cc5e0b70476fa52b43651123 Reviewed-on: https://go-review.googlesource.com/c/go/+/464435 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Auto-Submit: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/464795
* [release-branch.go1.19] cmd/go: remove tests that assume lack of new ↵Bryan C. Mills2023-02-101-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | versions of external modules In general it seems ok to assume that an open-source module that did exist will continue to do so — after all, users of open-source modules already do that all the time. However, we should not assume that those modules do not publish new versions — that's really up to their maintainers to decide. Two existing tests did make that assumption for the module gopkg.in/natefinch/lumberjack.v2. Let's remove those two tests. If we need to replace them at some point, we can replace them with hermetic test-only modules (#54503) or perhaps modules owned by the Go project. Updates #58445. Fixes #58449. Change-Id: Ica8fe587d86fc41f3d8445a4cd2b8820455ae45f Reviewed-on: https://go-review.googlesource.com/c/go/+/466862 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
* [release-branch.go1.19] cmd/go: skip test cases that depend on gopkg.inBryan C. Mills2023-02-092-1/+11
| | | | | | | | | | | | | | | | Updates #54503. Change-Id: Ie13d028b09260d2d316c343b3ea812bb9cce4e6d Reviewed-on: https://go-review.googlesource.com/c/go/+/424594 Auto-Submit: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Russ Cox <rsc@golang.org> (cherry picked from commit c7f870ebc41029e07e7ffd8ff2d96b91fd83cd40) Reviewed-on: https://go-review.googlesource.com/c/go/+/466857 Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
* [release-branch.go1.19] time: update windows zoneinfo_abbrsqmuntal2023-02-091-14/+16
| | | | | | | | | | | | | | | | | | | | | zoneinfo_abbrs hasn't been updated since go 1.14, it's time to regenerate it. Fixes #58118. Change-Id: Ic156ae607c46f1f5a9408b1fc0b56de6c14a4ed4 Reviewed-on: https://go-review.googlesource.com/c/go/+/463838 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Quim Muntal <quimmuntal@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> (cherry picked from commit 007d8f4db1f890f0d34018bb418bdc90ad4a8c35) Reviewed-on: https://go-review.googlesource.com/c/go/+/466555 TryBot-Bypass: David Chase <drchase@google.com> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Quim Muntal <quimmuntal@gmail.com> Reviewed-by: Than McIntosh <thanm@google.com>
* [release-branch.go1.19] net/http: accept HEAD requests with a bodyDamien Neil2023-01-304-23/+85
| | | | | | | | | | | | | | | | | | | | | | | RFC 7231 permits HEAD requests to contain a body, although it does state there are no defined semantics for payloads of HEAD requests and that some servers may reject HEAD requests with a payload. Accept HEAD requests with a body. Fix a bug where a HEAD request with a chunked body would interpret the body as the headers for the next request on the connection. For #53960. For #56154. Change-Id: I83f7112fdedabd6d6291cd956151d718ee6942cd Reviewed-on: https://go-review.googlesource.com/c/go/+/418614 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/457438 Reviewed-by: Than McIntosh <thanm@google.com>
* [release-branch.go1.19] runtime: fix performance regression in ↵Archana R2023-01-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | morestack_noctxt on ppc64 In the fix for 54332 the MOVD R1, R1 instruction was added to morestack_noctxt function to set the SPWRITE bit. However, the instruction MOVD R1, R1 results in or r1,r1,r1 which is a special instruction on ppc64 architecture as it changes the thread priority and can negatively impact performance in some cases. More details on such similar nops can be found in Power ISA v3.1 Book II on Power ISA Virtual Environment architecture in the chapter on Program Priority Registers and Or instructions. Replacing this by OR R0, R1 has the same affect on setting SPWRITE as needed by the first fix but does not affect thread priority and hence does not cause the degradation in performance Hash65536-64 2.81GB/s ±10% 16.69GB/s ± 0% +494.44% Fixes #57812 Change-Id: Ib912e3716c6afd277994d6c1c5b2891f82225d50 Reviewed-on: https://go-review.googlesource.com/c/go/+/461597 Reviewed-by: Benny Siegert <bsiegert@gmail.com> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Auto-Submit: Benny Siegert <bsiegert@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com> (cherry picked from commit 1c65b69bd1dbc930c6246877f6c21c81f2a60d55) Reviewed-on: https://go-review.googlesource.com/c/go/+/462335 Run-TryBot: Archana Ravindar <aravind5@in.ibm.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
* [release-branch.go1.19] crypto/x509: reduce boring test key sizeRoland Shoemaker2023-01-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | Generating 8192 bit keys times out on builders relatively frequently. We just need something that isn't a boringAllowCert allowed key size so we can test that a non-boringAllowCert signed intermediate works, so just use 512 instead since it'll be significantly faster. Fixes #57635 Updates #56798 Change-Id: I416e0d8c3aa11ff44e9870755efa95c74d1013f1 Reviewed-on: https://go-review.googlesource.com/c/go/+/451656 Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> (cherry picked from commit 38b9ff60071fc40d197e7002db1320539e74a678) Reviewed-on: https://go-review.googlesource.com/c/go/+/461615 Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
* [release-branch.go1.19] go1.19.5go1.19.5Gopher Robot2023-01-101-1/+1
| | | | | | | | | | Change-Id: I29de2897f400f576dfde497b4c51f7ee04696b36 Reviewed-on: https://go-review.googlesource.com/c/go/+/461358 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org> Run-TryBot: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Auto-Submit: Gopher Robot <gobot@golang.org>
* [release-branch.go1.19] misc/cgo/testcshared: handle unsuffixed dlltool pathThan McIntosh2023-01-091-22/+38
| | | | | | | | | | | | | | | | | | | | | | | | | Adapt the testcshared tests to handle the case where the path output by invoking gcc -print-prog-name=dlltool is a path lacking the final ".exe" suffix (this seems to be what clang is doing); tack it on before using if this is the case. Updates #57704. Fixes #57706. Change-Id: I04fb7b9fc90677880b1ced4a4ad2a8867a3f5f86 Reviewed-on: https://go-review.googlesource.com/c/go/+/451816 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> (cherry picked from commit 771a98d6b19c9ca4bbd3fbeba03d7d512f77c166) Reviewed-on: https://go-review.googlesource.com/c/go/+/461175 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
* [release-branch.go1.19] runtime: revert "call __fork instead of fork on darwin"Russ Cox2023-01-097-81/+17
| | | | | | | | | | | | | | | | | A recent comment on #57263 reports an unexplained crash in a cgo program that is fixed by reverting the __fork fix. We don't have any viable fix for the os/exec bug at this point, so give up on a fix for the January point releases. This reverts CL 459178 (commit 91bc4cd118dd). Fixes #57690. Change-Id: Ieb38d9bc7f967e9a726429eab2ea515d5ca0847f Reviewed-on: https://go-review.googlesource.com/c/go/+/461115 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
* [release-branch.go1.19] crypto/x509: return typed verification errors on macOSRoland Shoemaker2023-01-065-12/+40
| | | | | | | | | | | | | | | | | | | | | On macOS return the error code from SecTrustEvaluateWithError, and use it to create typed errors that can be returned from Verify. Updates #56891 Fixes #57427 Change-Id: Ib597ce202abb60702f730e75da583894422e4c14 Reviewed-on: https://go-review.googlesource.com/c/go/+/452620 Run-TryBot: Roland Shoemaker <roland@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> (cherry picked from commit c9a10d48a8f0e8479f5b9d98c5bd81b64a90d23d) Reviewed-on: https://go-review.googlesource.com/c/go/+/460895 Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Auto-Submit: Heschi Kreinick <heschi@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
* [release-branch.go1.19] crypto/x509: reallow duplicate attributes in CSRsRob Stradling2023-01-042-9/+25
| | | | | | | | | | | | | | | | | | | | Fixes #57556 Updates #54936 Change-Id: I3fb4331c2b1b6adafbac3e76eaf66c79cd5ef56f Reviewed-on: https://go-review.googlesource.com/c/go/+/428636 Run-TryBot: Roland Shoemaker <roland@golang.org> Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> (cherry picked from commit 56d18207823d6e1c18ca46409180c40ae800230c) Reviewed-on: https://go-review.googlesource.com/c/go/+/460236 Reviewed-by: Filippo Valsorda <filippo@golang.org> Auto-Submit: Heschi Kreinick <heschi@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Filippo Valsorda <filippo@golang.org>
* [release-branch.go1.19] cmd/compile: sign-extend the 2nd argument of the ↵David Chase2022-12-287-9/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LoweredAtomicCas32 on loong64,mips64x,riscv64 The function LoweredAtomicCas32 is implemented using the LL-SC instruction pair on loong64, mips64x, riscv64. However,the LL instruction on loong64, mips64x, riscv64 is sign-extended, so it is necessary to sign-extend the 2nd parameter "old" of the LoweredAtomicCas32, so that the instruction BNE after LL can get the desired result. The function prototype of LoweredAtomicCas32 in golang: func Cas32(ptr *uint32, old, new uint32) bool When using an intrinsify implementation: case 1: (*ptr) <= 0x80000000 && old < 0x80000000 E.g: (*ptr) = 0x7FFFFFFF, old = Rarg1= 0x7FFFFFFF After run the instruction "LL (Rarg0), Rtmp": Rtmp = 0x7FFFFFFF Rtmp ! = Rarg1(old) is false, the result we expect case 2: (*ptr) >= 0x80000000 && old >= 0x80000000 E.g: (*ptr) = 0x80000000, old = Rarg1= 0x80000000 After run the instruction "LL (Rarg0), Rtmp": Rtmp = 0xFFFFFFFF_80000000 Rtmp ! = Rarg1(old) is true, which we do not expect When using an non-intrinsify implementation: Because Rarg1 is loaded from the stack using sign-extended instructions ld.w, the situation described in Case 2 above does not occur Benchmarks on linux/loong64: name old time/op new time/op delta Cas 50.0ns ± 0% 50.1ns ± 0% ~ (p=1.000 n=1+1) Cas64 50.0ns ± 0% 50.1ns ± 0% ~ (p=1.000 n=1+1) Cas-4 56.0ns ± 0% 56.0ns ± 0% ~ (p=1.000 n=1+1) Cas64-4 56.0ns ± 0% 56.0ns ± 0% ~ (p=1.000 n=1+1) Benchmarks on Loongson 3A4000 (GOARCH=mips64le, 1.8GHz) name old time/op new time/op delta Cas 70.4ns ± 0% 70.3ns ± 0% ~ (p=1.000 n=1+1) Cas64 70.7ns ± 0% 70.6ns ± 0% ~ (p=1.000 n=1+1) Cas-4 81.1ns ± 0% 80.8ns ± 0% ~ (p=1.000 n=1+1) Cas64-4 80.9ns ± 0% 80.9ns ± 0% ~ (p=1.000 n=1+1) Fixes #57345 Change-Id: I190a7fc648023b15fa392f7fdda5ac18c1561bac Reviewed-on: https://go-review.googlesource.com/c/go/+/457135 Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Wayne Zuo <wdvxdr@golangcn.org> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/458355 Run-TryBot: David Chase <drchase@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
* [release-branch.go1.19] cmd/link: recognize the new R_LARCH_32_PCREL type on ↵Cherry Mui2022-12-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | loong64 This is a minimum backport of CL 420983 without an API change in debug/elf. Original CL description: Due to the latest binutils change [1], at least for certain 32-bit relocs in .eh_frame section, this new type of relocation record is emitted, leading to breakage on systems with bleeding-edge toolchain when trying to link with object(s) with such new-style relocs. Simply treating it the same as the existing reloc types seems enough. Updates #54222. Fixes #57444. [1]: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=f09482a8747b6fd4c2d59a6a64677d3a3fe1e092 Change-Id: Idd86294a11c1d13b88acbca59e537656a57d8109 Reviewed-on: https://go-review.googlesource.com/c/go/+/458836 Reviewed-by: WANG Xuerui <git@xen0n.name> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com>
* [release-branch.go1.19] cmd/compile: fix broken IR for iface -> efaceCuong Manh Le2022-12-282-3/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For implementing interface to empty interface conversion, the compiler generate code like: var res *uint8 res = itab if res != nil { res = res.type } However, itab has type *uintptr, so the assignment is broken. The problem is not shown up, until CL 450215, which call typecheck on this broken assignment. To fix this, just cast itab to *uint8 when doing the conversion. Fixes #56770 Change-Id: Id42792d18e7f382578b40854d46eecd49673792c Reviewed-on: https://go-review.googlesource.com/c/go/+/451256 Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/451875 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Joedian Reid <joedian@golang.org>
* [release-branch.go1.19] runtime: call __fork instead of fork on darwinRuss Cox2022-12-227-17/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issues #33565 and #56784 were caused by hangs in the child process after fork, while it ran atfork handlers that ran into slow paths that didn't work in the child. CL 451735 worked around those two issues by calling a couple functions at startup to try to warm up those child paths. That mostly worked, but it broke programs using cgo with certain macOS frameworks (#57263). CL 459175 reverted CL 451735. This CL introduces a different fix: bypass the atfork child handlers entirely. For a general fork call where the child and parent are both meant to keep executing the original program, atfork handlers can be necessary to fix any state that would otherwise be tied to the parent process. But Go only uses fork as preparation for exec, and it takes care to limit what it attempts to do in the child between the fork and exec. In particular it doesn't use any of the things that the macOS atfork handlers are trying to fix up (malloc, xpc, others). So we can use the low-level fork system call (__fork) instead of the atfork-wrapped one. The full list of functions that can be called in a child after fork in exec_libc2.go is: - ptrace - setsid - setpgid - getpid - ioctl - chroot - setgroups - setgid - setuid - chdir - dup2 - fcntl - close - execve - write - exit I disassembled all of these while attached to a hung exec.test binary and confirmed that nearly all of them are making direct kernel calls, not using anything that the atfork handler needs to fix up. The exceptions are ioctl, fcntl, and exit. The ioctl and fcntl implementations do some extra work around the kernel call but don't call any other functions, so they should still be OK. (If not, we could use __ioctl and __fcntl instead, but without a good reason, we should keep using the standard entry points.) The exit implementation calls atexit handlers. That is almost certainly inappropriate in a failed fork child, so this CL changes that call to __exit on darwin. To avoid making unnecessary changes at this point in the release cycle, this CL leaves OpenBSD calling plain exit, even though that is probably a bug in the OpenBSD port (filed #57446). Fixes #33565. Fixes #56784. Fixes #57263. Fixes #56837. Change-Id: I26812c26a72bdd7fcf72ec41899ba11cf6b9c4ab Reviewed-on: https://go-review.googlesource.com/c/go/+/459176 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/459178
* [release-branch.go1.19] syscall, internal/poll: fall back to accept on linux-armIan Lance Taylor2022-12-216-17/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our minimum Linux version is 2.6.32, and the accept4 system call was introduced in 2.6.28, so we use accept4 everywhere. Unfortunately, it turns out that the accept4 system call was only added to linux-arm in 2.6.36, so for linux-arm only we need to try the accept4 system call and then fall back to accept if it doesn't work. The code we use on linux-arm is the code we used in Go 1.17. On non-arm platforms we continue using the simpler code introduced in Go 1.18. Adding accept4 to the ARM Linux kernel was: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=21d93e2e29722d7832f61cc56d73fb953ee6578e For #57333 Fixes #57339 Change-Id: I6680cb54dd4d3514a6887dda8906e6708c64459d Reviewed-on: https://go-review.googlesource.com/c/go/+/457996 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Than McIntosh <thanm@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
* [release-branch.go1.19] cmd/compile: fix conditional move rule on PPC64Keith Randall2022-12-193-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | Similar to CL 456556 but for ppc64 instead of arm64. Change docs about how booleans are stored in registers for ppc64. We now don't promise to keep the upper bits zeroed; they might be junk. To test, I changed the boolean generation instructions (MOVBZload* and ISEL* with boolean type) to OR in 0x100 to the result. all.bash still passed, so I think nothing else is depending on the upper bits of booleans. Update #57212 Change-Id: Ie66f8934a0dafa34d0a8c2a37324868d959a852c Reviewed-on: https://go-review.googlesource.com/c/go/+/456437 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: KAMPANAT THUMWONG (KONG PC) <1992kongpc.kth@gmail.com> Run-TryBot: Archana Ravindar <aravind5@in.ibm.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/456736 Reviewed-by: Than McIntosh <thanm@google.com>
* [release-branch.go1.19] cmd/compile: fix conditional select ruleKeith Randall2022-12-193-5/+45
| | | | | | | | | | | | | | | | | | | ARM64 maintains booleans in the low byte of registers. Upper parts of that register are junk. This rule is using all 32 bits of a boolean-containing register, which is wrong. Change the rule to only look at the low bit. Fixes #57212 Change-Id: Ibbef86b2be859df3d06d993db00e1231c481c428 Reviewed-on: https://go-review.googlesource.com/c/go/+/456556 Auto-Submit: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/456559 Reviewed-by: Than McIntosh <thanm@google.com>
* [release-branch.go1.19] all: upgrade golang.org/x/net to ↵Damien Neil2022-12-194-10/+5
| | | | | | | | | | | | | | | v0.0.0-20221214163817-183621ab9c4e Update x/net to include the fix for #53960. For #53960 For #56154 Change-Id: Ib3e0d66e4125601e20f1b2e3040f29e7ebd4b080 Reviewed-on: https://go-review.googlesource.com/c/go/+/457556 Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
* [release-branch.go1.19] os: skip size test in TestLstat if the file is a symlinkIan Lance Taylor2022-12-141-3/+5
| | | | | | | | | | | | | | | | | | | | | | Tested by temporarily changing sysdir to use a directory where the expected files were all symlinks. We should consider using a different approach that doesn't rely on sysdir, but for now do a minimal fix. For #57210 Fixes #57214 Change-Id: Ifb1becef03e014ceb48290ce13527b3e103c0e07 Reviewed-on: https://go-review.googlesource.com/c/go/+/456557 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 9b8750f53ed89fb326e4d811524e647683136bac) Reviewed-on: https://go-review.googlesource.com/c/go/+/456560 Reviewed-by: Austin Clements <austin@google.com>
* [release-branch.go1.19] cmd/compile: fix missing typecheck for static ↵Cuong Manh Le2022-12-092-0/+46
| | | | | | | | | | | | | | | | | | | | | initialization slice CL 440455 fixed missing walk pass for static initialization slice. However, slicelit may produce un-typechecked node, thus we need to do typecheck for sinit before calling walkStmtList. Fixes #56744 Change-Id: I40730cebcd09f2be4389d71c5a90eb9a060e4ab7 Reviewed-on: https://go-review.googlesource.com/c/go/+/450215 Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/451155 Reviewed-by: Joedian Reid <joedian@golang.org>
* [release-branch.go1.19] cmd/link/internal/ppc64: fix trampoline reuse ↵Paul E. Murphy2022-12-092-2/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | distance calculation If a compatible trampoline has been inserted by a previously laid function in the same section, and is known to be sufficiently close, it can be reused. When testing if the trampoline can be reused, the addend of the direct call should be ignored. It is already encoded in the trampoline. If the addend is non-zero, and the target sufficiently far away, and just beyond direct call reach, this may cause the trampoline to be incorrectly reused. This was observed on go1.17.13 and openshift-installer commit f3c53b382 building in release mode with the following error: github.com/aliyun/alibaba-cloud-sdk-go/services/cms.(*Client).DescribeMonitoringAgentAccessKeyWithChan.func1: direct call too far: runtime.duffzero+1f0-tramp0-1 -2000078 Fixes #56834 Change-Id: I54af957302506d4e3cd5d3121542c83fe980e912 Reviewed-on: https://go-review.googlesource.com/c/go/+/451415 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Paul Murphy <murp@ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/451417 Reviewed-by: Joedian Reid <joedian@golang.org>
* [release-branch.go1.19] cmd/go: remove TestScript/version_buildvcs_git_gpgBryan C. Mills2022-12-091-105/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a regression test added for a 'git' command line used for build stamping. Unfortunately, 'gpg' has proved to be extremely fragile: * In recent versions, it appears to always require 'gpg-agent' to be installed for anything involving secret keys, but for some reason is not normally marked as requiring gpg-agent in Debian's package manager. * It tries to create a Unix domain socket in a subdirectory of $TMPDIR without checking the path length, which fails when $TMPDIR is too long to fit in the 'sun_path' field of a sockaddr_un struct (which typically tops out somewhere between 92 and 108 bytes). We could theoretically address those by artificially reducing the script's TMPDIR length and checking for gpg-agent in addition to gpg, but arguably those should both be fixed upstream instead. On balance, the incremental value that this test provides does not seem worth the complexity of dealing with such a fragile third-party tool. Updates #50675. Updates #48802. Updates #57034. Fixes #57055. Change-Id: Ia3288c2f84f8db86ddfa139b4d1c0112d67079ef Reviewed-on: https://go-review.googlesource.com/c/go/+/454502 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> (cherry picked from commit 45f5ef4ed7a774b6911650319a265e17ee9e6e0e) Reviewed-on: https://go-review.googlesource.com/c/go/+/454955
* [release-branch.go1.19] sync/atomic: allow linked list of atomic pointers againRuss Cox2022-12-092-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For #56603, CL 448275 added a _ [0]T field to atomic.Pointer, so that different kinds of atomic.Pointer are not convertible. Unfortunately, that breaks code like: type List struct { Next atomic.Pointer[List] } which should be valid, just as using Next *List is valid. Instead, we get: ./atomic_test.go:2533:6: invalid recursive type List ./atomic_test.go:2533:6: List refers to ./atomic_test.go:2534:13: "sync/atomic".Pointer refers to ./atomic_test.go:2533:6: List Fix by using _[0]*T instead. For #56638. Fixes #57124. Change-Id: Icc4c83c691d35961d20cb14b824223d6c779ac5e Reviewed-on: https://go-review.googlesource.com/c/go/+/450655 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> (cherry picked from commit b14cf3d93ae5c477dd35f13f6ba41044f01a7f7d) Reviewed-on: https://go-review.googlesource.com/c/go/+/452438 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
* [release-branch.go1.19] net: reenable SRV tests with _ldap._tcp.google.comDamien Neil2022-12-091-16/+8
| | | | | | | | | | | | | | | | | | | | | | TestLookupDotsWithRemoteSource and TestLookupGoogleSRV were disabled because they look up the no-longer-present SRV record for _xmpp-server._tcp.google.com. Change the tests to look for _ldap._tcp.google.com and reenable them. For #56708. Fixes #56712. Change-Id: I26475fa3ff6fc008048a4e5f24f0e96ee12f655c Reviewed-on: https://go-review.googlesource.com/c/go/+/453861 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 3b3ab616925fb820d5168727d92f1745020f9f9d) Reviewed-on: https://go-review.googlesource.com/c/go/+/454296 Auto-Submit: Damien Neil <dneil@google.com> Reviewed-by: Jenny Rakoczy <jenny@golang.org>
* [release-branch.go1.19] cmd/go: skip TestScript/mod_replace_gopkginBryan C. Mills2022-12-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (Until it can be made hermetic.) The gopkg.in service has had a lot of flakiness lately. Go users in general are isolated from that flakiness by the Go module mirror (proxy.golang.org), but this test intentionally bypasses the module mirror because the mirror itself uses cmd/go to download the module. In the long term, we can redirect the gopkg.in URL to the local (in-process) vcweb server added for #27494. In the meantime, let's skip the test to reduce the impact of upstream outages. Fixes #57058. Updates #54503. Change-Id: Icf3de7ca416db548e53864a71776fe22b444fcea Reviewed-on: https://go-review.googlesource.com/c/go/+/454503 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> (cherry picked from commit c5f5cb659adda026d01b7fa9bd39b2ad3b58c5bf) Reviewed-on: https://go-review.googlesource.com/c/go/+/454839 Reviewed-by: Michael Pratt <mpratt@google.com>
* [release-branch.go1.19] cmd/compile: turn off jump tables when spectre ↵Keith Randall2022-12-092-1/+29
| | | | | | | | | | | | | | | | retpolines are on Fixes #57100 Change-Id: I6ab659abbca1ae0ac8710674d39aec116fab0baa Reviewed-on: https://go-review.googlesource.com/c/go/+/455336 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Keith Randall <khr@golang.org> (cherry picked from commit 1eb0465fa596a2d6e9c1a632499989544f0d7e68) Reviewed-on: https://go-review.googlesource.com/c/go/+/455416 Reviewed-by: Michael Pratt <mpratt@google.com>
* [release-branch.go1.19] go1.19.4go1.19.4Gopher Robot2022-12-061-1/+1
| | | | | | | | | | Change-Id: I5aced88de64f51c6f20ddf11dc8301bdf779a5e8 Reviewed-on: https://go-review.googlesource.com/c/go/+/455598 Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: Gopher Robot <gobot@golang.org> Reviewed-by: Jenny Rakoczy <jenny@golang.org> Auto-Submit: Gopher Robot <gobot@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
* [release-branch.go1.19] net/http: update bundled golang.org/x/net/http2Damien Neil2022-12-062-7/+13
| | | | | | | | | | | | | | | | | | Disable cmd/internal/moddeps test, since this update includes PRIVATE track fixes. For #56350. For #57009. Fixes CVE-2022-41717. Change-Id: I5c6ce546add81f361dcf0d5123fa4eaaf8f0a03b Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1663835 Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-by: Julie Qiu <julieqiu@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/455363 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Jenny Rakoczy <jenny@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
* [release-branch.go1.19] os, net/http: avoid escapes from os.DirFS and ↵Damien Neil2022-12-069-9/+328
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http.Dir on Windows Do not permit access to Windows reserved device names (NUL, COM1, etc.) via os.DirFS and http.Dir filesystems. Avoid escapes from os.DirFS(`\`) on Windows. DirFS would join the the root to the relative path with a path separator, making os.DirFS(`\`).Open(`/foo/bar`) open the path `\\foo\bar`, which is a UNC name. Not only does this not open the intended file, but permits reference to any file on the system rather than only files on the current drive. Make os.DirFS("") invalid, with all file access failing. Previously, a root of "" was interpreted as "/", which is surprising and probably unintentional. Fixes CVE-2022-41720 Fixes #56694 Change-Id: I275b5fa391e6ad7404309ea98ccc97405942e0f0 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1663834 Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-by: Julie Qiu <julieqiu@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/455362 Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Jenny Rakoczy <jenny@golang.org>
* [release-branch.go1.19] testing: skip flaky TestRaiseException on ↵Than McIntosh2022-11-301-1/+1
| | | | | | | | | | | | | | | | | | | | | windows-amd64-2012-* Modify skip rule for TestRaiseException to trigger on both the base builder (windows-amd64-2012) and the oldcc legacy builder (windows-amd64-2012-oldcc) used for 1.18/1.19 testing. Updates #56983. Change-Id: I132f9ddd102666b68ad04cc661fdcc2cd841051a Reviewed-on: https://go-review.googlesource.com/c/go/+/451294 Auto-Submit: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> (cherry picked from commit f0331c524e0d8d32c3918d3515ab8413f38dbd56) Reviewed-on: https://go-review.googlesource.com/c/go/+/454035 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Bypass: Than McIntosh <thanm@google.com>
* [release-branch.go1.19] runtime: make GC see object as allocated after it is ↵Cherry Mui2022-11-254-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialized When the GC is scanning some memory (possibly conservatively), finding a pointer, while concurrently another goroutine is allocating an object at the same address as the found pointer, the GC may see the pointer before the object and/or the heap bits are initialized. This may cause the GC to see bad pointers and possibly crash. To prevent this, we make it that the scanner can only see the object as allocated after the object and the heap bits are initialized. Currently the allocator uses freeindex to find the next available slot, and that code is coupled with updating the free index to a new slot past it. The scanner also uses the freeindex to determine if an object is allocated. This is somewhat racy. This CL makes the scanner use a different field, which is only updated after the object initialization (and a memory barrier). Updates #54596. Fixes #56752. Change-Id: I2a57a226369926e7192c253dd0d21d3faf22297c Reviewed-on: https://go-review.googlesource.com/c/go/+/449017 Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit febe7b8e2a4dd7cce6ab8d02cf79a5430819cbe5) Reviewed-on: https://go-review.googlesource.com/c/go/+/453235
* [release-branch.go1.19] crypto/x509: allow BoringCrypto to use 4096-bit keysRuss Cox2022-11-134-52/+73
| | | | | | | | | | | | | | | | FIPS-140 has been updated to allow 4096-bit RSA keys. Allow them in certificate processing. For #41147. Fixes #56672. Change-Id: I4c6bcb1b137a200dfe70cebc605ae57f49871184 Reviewed-on: https://go-review.googlesource.com/c/go/+/447655 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/449016
* [release-branch.go1.19] net: disable TestLookupDotsWithRemoteSource and ↵Michael Anthony Knyszek2022-11-111-0/+8
| | | | | | | | | | | | | | | | | | | | | TestLookupGoogleSRV These tests fail consistently due to a DNS change causing widespread trybot outages. For #56707. Fixes #56710. Change-Id: Iebdf91254a922a48880021198f0f12f6bc16b6e7 Reviewed-on: https://go-review.googlesource.com/c/go/+/449640 Reviewed-by: Carlos Amedee <carlos@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> (cherry picked from commit 97765249082b6835c77517a4e63bb38cfd6db97b) Reviewed-on: https://go-review.googlesource.com/c/go/+/449506 Reviewed-by: Ian Lance Taylor <iant@google.com>
* [release-branch.go1.19] sync/atomic: disallow type conversions of ↵Mateusz Poliwczak2022-11-111-0/+4
| | | | | | | | | | | | | | | | | | | atomic.Pointer[T] For #56603. Fixes #56638. Change-Id: I6af9d80201025ae4028bfaa4a62e5de9ac0c501d GitHub-Last-Rev: e6ed5e14512e1221a3c6cb181406cf00eec07e99 GitHub-Pull-Request: golang/go#56604 Reviewed-on: https://go-review.googlesource.com/c/go/+/448275 Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> (cherry picked from commit 6bead8f77afd2f7317eb011ca019b61ac3d90c17) Reviewed-on: https://go-review.googlesource.com/c/go/+/448518 Run-TryBot: Michael Knyszek <mknyszek@google.com>
* [release-branch.go1.19] runtime: don't jump stack if at entry of systemstackCherry Mui2022-11-091-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The traceback code has special "jump stack" logic, to trace back stack switches through systemstack. If we're at the entry of systemstack, the stack switch hasn't happened, so don't jump to user stack. The jump stack logic is only used if we're on the g0 stack. It can happen that we're at the entry of a recursive systemstack call on the g0 stack. In we jump stack here, there will be two problems: 1. There are frames between entering the g0 stack and this recursive systemstack call. Those frames will be lost. 2. Worse, we switched frame.sp but frame.fp calculation will use the entry SP delta (0), which will be wrong, which in turn leads wrong frame.lr and things will go off. For now, don't jump stack if we're at entry of systemstack (SP delta is 0). Using a per-PC SPWRITE marker may be a better fix. If we haven't written the SP, we haven't switched the stack so we can just unwind like a normal function. Updates #55851. Fixes #56636. Change-Id: I2b624c8c086b235b34d9c7d3cebd4a37264f00f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/437299 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> (cherry picked from commit 500bc6b8056ee2eaf7640610a48ffa00bdd896a5) Reviewed-on: https://go-review.googlesource.com/c/go/+/448516
* [release-branch.go1.19] cmd/compile: allow ineffectual //go:linkname in ↵Matthew Dempsky2022-11-092-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | -lang=go1.17 and older Prior to Go 1.18, ineffectual //go:linkname directives (i.e., directives referring to an undeclared name, or to a declared type or constant) were treated as noops. In Go 1.18, we changed this into a compiler error to mitigate accidental misuse. However, the x/sys repo contained ineffectual //go:linkname directives up until go.dev/cl/274573, which has caused a lot of user confusion. It seems a bit late to worry about now, but to at least prevent further user pain, this CL changes the error message to only apply to modules using "go 1.18" or newer. (The x/sys repo declared "go 1.12" at the time go.dev/cl/274573 was submitted.) For #55889. Fixes #56557. Change-Id: Id762fff96fd13ba0f1e696929a9e276dfcba2620 Reviewed-on: https://go-review.googlesource.com/c/go/+/447755 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/447816
* [release-branch.go1.19] os/exec: allow NUL in environment variables on Plan 9Matthew Dempsky2022-11-093-6/+20
| | | | | | | | | | | | | | | | | | | Plan 9 uses NUL as os.PathListSeparator, so it's almost always going to appear in the environment variable list. Exempt GOOS=plan9 from the check for NUL in environment variables. For #56284. For #56544. Fixes #56551. Change-Id: I23df233cdf20c0a9a606fd9253e15a9b5482575a Reviewed-on: https://go-review.googlesource.com/c/go/+/447715 Reviewed-by: David du Colombier <0intro@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/447799 Run-TryBot: David du Colombier <0intro@gmail.com>
* [release-branch.go1.19] cmd/compile: copy blank parameter node when ↵Cherry Mui2022-11-082-1/+74
| | | | | | | | | | | | | | | | | | | | | | | | | substituting function type When a function type is copied (e.g. for substituting type parameters), we make copies of its parameter ir.Name nodes, so they are not shared with the old function type. But currently a blank (_) identifier is not copied but shared. The parameter node's frame offset is assigned (in ABI analysis) and then used in the concurrent backend. Shared node can cause a data race. Make a new blank parameter node to avoid sharing. (Unified IR does already not have this problem. This fixes non-unified-IR mode.) Updates #55357. Fixes #56360. Change-Id: Ie27f08e5589ac7d5d3f0d0d5de1a21e4fd2765c9 Reviewed-on: https://go-review.googlesource.com/c/go/+/443158 Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> (cherry picked from commit 4725c71b735143a138b24f2b0e055c717d8d69ca) Reviewed-on: https://go-review.googlesource.com/c/go/+/445176
* [release-branch.go1.19] runtime: fix usleep on linux/PPC64Paul E. Murphy2022-11-081-8/+15
| | | | | | | | | | | | | | | | | | | | The existing implementation fails to convert the remainder microseconds to nanoseconds. This causes sysmon to consume much more cpu, and generate lots of context switches. We can also do a little better here to avoid division by a constant. I used go to determine the magic numbers. Fixes #56397 Change-Id: I2e37ec218b9027efab6db4634eed1504c0c1b3c8 Reviewed-on: https://go-review.googlesource.com/c/go/+/444735 Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Run-TryBot: Paul Murphy <murp@ibm.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/445157
* [release-branch.go1.19] crypto/x509: respect GODEBUG changes for allowing ↵Russ Cox2022-11-083-12/+7
| | | | | | | | | | | | | | | | | | | | SHA1 certificates This allows programs that want SHA1 support to call os.Setenv at startup instead of insisting that users set the environment variable themselves. For #41682. Fixes #56436. Fixes #56438. Change-Id: Idcb96212a1d8c560e1dd8eaf7c80b6266f16431e Reviewed-on: https://go-review.googlesource.com/c/go/+/445496 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/445655
* [release-branch.go1.19] go1.19.3go1.19.3Gopher Robot2022-11-011-1/+1
| | | | | | | | | | Change-Id: I167308920eeb7480efb626ce75f777a335e870b0 Reviewed-on: https://go-review.googlesource.com/c/go/+/446958 Run-TryBot: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
* [release-branch.go1.19] syscall, os/exec: reject environment variables ↵Damien Neil2022-11-014-15/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | containing NULs Check for and reject environment variables containing NULs. The conventions for passing environment variables to subprocesses cause most or all systems to interpret a NUL as a separator. The syscall package rejects environment variables containing a NUL on most systems, but erroneously did not do so on Windows. This causes an environment variable such as "FOO=a\x00BAR=b" to be interpreted as "FOO=a", "BAR=b". Check for and reject NULs in environment variables passed to syscall.StartProcess on Windows. Add a redundant check to os/exec as extra insurance. Updates #56284 Fixes #56328 Fixes CVE-2022-41716 Change-Id: I2950e2b0cb14ebd26e5629be1521858f66a7d4ae Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1609434 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-by: Roland Shoemaker <bracewell@google.com> TryBot-Result: Security TryBots <security-trybots@go-security-trybots.iam.gserviceaccount.com> (cherry picked from commit 845accdebb2772c5344ed0c96df9910f3b02d741) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1617553 Run-TryBot: Tatiana Bradley <tatianabradley@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/446879 Reviewed-by: Tatiana Bradley <tatiana@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
* [release-branch.go1.19] cmd/compile: fix missing walk pass for static ↵Cuong Manh Le2022-10-242-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | initialization slice CL 403995 fixed static init of literal contains dynamic exprs, by ensuring their init are ordered properly. However, we still need to walk the generated init codes before appending to parent init. Otherwise, codes that requires desugaring will be unhandled, causing the compiler backend crashing. Fixes #56106 Change-Id: Ic25fd4017473f5412c8e960a91467797a234edfd Reviewed-on: https://go-review.googlesource.com/c/go/+/440455 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/441995 Reviewed-by: Joedian Reid <joedian@golang.org> Reviewed-by: David Chase <drchase@google.com>