aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-09-06[release-branch.go1.21] go1.21.1go1.21.1Gopher Robot
Change-Id: I1c208f9cd77af66e98a4d159c2e6c3b6072ea7ec Reviewed-on: https://go-review.googlesource.com/c/go/+/526039 Run-TryBot: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Joedian Reid <joedian@golang.org> Auto-Submit: Gopher Robot <gobot@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-09-06[release-branch.go1.21] html/template: properly handle special tags within ↵Roland Shoemaker
the script context The HTML specification has incredibly complex rules for how to handle "<!--", "<script", and "</script" when they appear within literals in the script context. Rather than attempting to apply these restrictions (which require a significantly more complex state machine) we apply the workaround suggested in section 4.12.1.3 of the HTML specification [1]. More precisely, when "<!--", "<script", and "</script" appear within literals (strings and regular expressions, ignoring comments since we already elide their content) we replace the "<" with "\x3C". This avoids the unintuitive behavior that using these tags within literals can cause, by simply preventing the rendered content from triggering it. This may break some correct usages of these tags, but on balance is more likely to prevent XSS attacks where users are unknowingly either closing or not closing the script blocks where they think they are. Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this issue. Fixes #62197 Fixes #62398 Fixes CVE-2023-39319 [1] https://html.spec.whatwg.org/#restrictions-for-contents-of-script-elements Change-Id: Iab57b0532694827e3eddf57a7497ba1fab1746dc Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1976594 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-by: Damien Neil <dneil@google.com> Run-TryBot: Roland Shoemaker <bracewell@google.com> Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/2014619 Reviewed-on: https://go-review.googlesource.com/c/go/+/526097 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-09-06[release-branch.go1.21] html/template: support HTML-like comments in script ↵Roland Shoemaker
contexts Per Appendix B.1.1 of the ECMAScript specification, support HTML-like comments in script contexts. Also per section 12.5, support hashbang comments. This brings our parsing in-line with how browsers treat these comment types. Thanks to Takeshi Kaneko (GMO Cybersecurity by Ierae, Inc.) for reporting this issue. Fixes #62196 Fixes #62396 Fixes CVE-2023-39318 Change-Id: Id512702c5de3ae46cf648e268cb10e1eb392a181 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1976593 Run-TryBot: Roland Shoemaker <bracewell@google.com> Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/2014618 Reviewed-on: https://go-review.googlesource.com/c/go/+/526096 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com>
2023-09-06[release-branch.go1.21] cmd/go: reject toolchain directives containing path ↵Bryan C. Mills
separators If GOTOOLCHAIN="path" or "auto", the go command uses exec.LookPath to search for it in order to allow toolchains to refer to local-only toolchain variants (such as toolchains built from enterprise- or distro-patched source). However, those toolchains should only be resolved from $PATH, not relative to the working directory of the command. Thanks to Juho Nurminen of Mattermost for reporting this issue. Fixes #62198. Fixes #62394. Fixes CVE-2023-39320. Change-Id: I247c7acea95d737362dd0475e9fc8515430d0fcc Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1996318 Run-TryBot: Roland Shoemaker <bracewell@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Roland Shoemaker <bracewell@google.com> (cherry picked from commit e41c0a55d45e9a9acbc5d7c1143ea4fff8fb9283) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/2014013 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/526095 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com>
2023-08-31[release-branch.go1.21] net/http: revert "support streaming POST content in ↵haruyama480
wasm" CL 458395 added support for streaming POST content in Wasm. Unfortunately, this breaks requests to servers that only support HTTP/1.1. Revert the change until a suitable fallback or opt-in strategy can be decided. For #61889. Fixes #62328. Change-Id: If53a77e1890132063b39abde867d34515d4ac2af Reviewed-on: https://go-review.googlesource.com/c/go/+/522955 Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/524855 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Commit-Queue: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-30[release-branch.go1.21] runtime: restore caller's frame pointer when ↵Nick Ripley
recovering from panic When recovering from a panic, restore the caller's frame pointer before returning control to the caller. Otherwise, if the function proceeds to run more deferred calls before returning, the deferred functions will get invalid frame pointers pointing to an address lower in the stack. This can cause frame pointer unwinding to crash, such as if an execution trace event is recorded during the deferred call on architectures which support frame pointer unwinding. Original CL by Nick Ripley, includes fix from CL 523697, and includes a test update from CL 524315. This CL also deviates from the original fix by doing some extra computation to figure out the fp from the sp, since we don't have the fp immediately available to us in `recovery` on the Go 1.21 branch, and it would probably be complicated to plumb that through its caller. For #61766 Fixes #62046 Change-Id: I5a99ca4f909f6b6e209a330d595d1c99987d4359 Reviewed-on: https://go-review.googlesource.com/c/go/+/523698 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-08-30[release-branch.go1.21] runtime: avoid MADV_HUGEPAGE for heap memoryMichael Anthony Knyszek
Currently the runtime marks all new memory as MADV_HUGEPAGE on Linux and manages its hugepage eligibility status. Unfortunately, the default THP behavior on most Linux distros is that MADV_HUGEPAGE blocks while the kernel eagerly reclaims and compacts memory to allocate a hugepage. This direct reclaim and compaction is unbounded, and may result in significant application thread stalls. In really bad cases, this can exceed 100s of ms or even seconds. Really all we want is to undo MADV_NOHUGEPAGE marks and let the default Linux paging behavior take over, but the only way to unmark a region as MADV_NOHUGEPAGE is to also mark it MADV_HUGEPAGE. The overall strategy of trying to keep hugepages for the heap unbroken however is sound. So instead let's use the new shiny MADV_COLLAPSE if it exists. MADV_COLLAPSE makes a best-effort synchronous attempt at collapsing the physical memory backing a memory region into a hugepage. We'll use MADV_COLLAPSE where we would've used MADV_HUGEPAGE, and stop using MADV_NOHUGEPAGE altogether. Because MADV_COLLAPSE is synchronous, it's also important to not re-collapse huge pages if the huge pages are likely part of some large allocation. Although in many cases it's advantageous to back these allocations with hugepages because they're contiguous, eagerly collapsing every hugepage means having to page in at least part of the large allocation. However, because we won't use MADV_NOHUGEPAGE anymore, we'll no longer handle the fact that khugepaged might come in and back some memory we returned to the OS with a hugepage. I've come to the conclusion that this is basically unavoidable without a new madvise flag and that it's just not a good default. If this change lands, advice about Linux huge page settings will be added to the GC guide. Verified that this change doesn't regress Sweet, at least not on my machine with: /sys/kernel/mm/transparent_hugepage/enabled [always or madvise] /sys/kernel/mm/transparent_hugepage/defrag [madvise] /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_none [0 or 511] Unfortunately, this workaround means that we only get forced hugepages on Linux 6.1+. For #61718. Fixes #62329. Change-Id: I7f4a7ba397847de29f800a99f9cb66cb2720a533 Reviewed-on: https://go-review.googlesource.com/c/go/+/516795 Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com> (cherry picked from commit 9f9bb26880388c5bead158e9eca3be4b3a9bd2af) Reviewed-on: https://go-review.googlesource.com/c/go/+/523655 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-30[release-branch.go1.21] go/types, types2: remove order dependency in ↵Robert Griesemer
inference involving channels In inexact unification, when a named type matches against an inferred unnamed type, we change the previously inferred type to the named type. This preserves the type name and assignability. We have to do the same thing when encountering a directional channel: a bidirectional channel can always be assigned to a directional channel but not the other way around. Thus, if we see a directional channel, we must choose the directional channel. This CL extends the previously existing logic for named types to directional channels and also makes the code conditional on inexact unification. The latter is an optimization - if unification is exact, type differences don't exist and updating an already inferred type has no effect. Fixes #62205. Change-Id: I807e3b9f9ab363f9ed848bdb18b2577b1d680ea7 Reviewed-on: https://go-review.googlesource.com/c/go/+/524256 Run-TryBot: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
2023-08-30[release-branch.go1.21] cmd/go: retry ETXTBSY errors when running test binariesBryan C. Mills
An ETXTBSY error when starting a test binary is almost certainly caused by the race reported in #22315. That race will resolve quickly on its own, so we should just retry the command instead of reporting a spurious failure. Fixes #62222. Updates #62221. Change-Id: I408f3eaa7ab5d7efbc7a2b1c8bea3dbc459fc794 Reviewed-on: https://go-review.googlesource.com/c/go/+/522015 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> (cherry picked from commit 4dc2564933146efc411efad16b662589306744d1) Reviewed-on: https://go-review.googlesource.com/c/go/+/522176 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-30[release-branch.go1.21] crypto/tls: QUIC: fix panics when processing ↵Damien Neil
post-handshake messages The check for fragmentary post-handshake messages in QUICConn.HandleData was reversed, resulting in a potential panic when HandleData receives a partial message. In addition, HandleData wasn't checking the size of buffered post-handshake messages. Produce an error when a post-handshake message is larger than maxHandshake. TestQUICConnectionState was using an onHandleCryptoData hook in runTestQUICConnection that was never being called. (I think it was inadvertently removed at some point while the CL was in review.) Fix this test while making the hook more general. For #62266 Fixes #62290 Change-Id: I210b70634e50beb456ab3977eb11272b8724c241 Reviewed-on: https://go-review.googlesource.com/c/go/+/522595 Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Marten Seemann <martenseemann@gmail.com> Reviewed-by: Roland Shoemaker <roland@golang.org> (cherry picked from commit e92c0f846c54d88f479b1c48f0dbc001d2ff53e9) Reviewed-on: https://go-review.googlesource.com/c/go/+/523039 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2023-08-30[release-branch.go1.21] cmd/go: find GOROOT using os.Executable when ↵Bryan C. Mills
installed to GOROOT/bin/GOOS_GOARCH When running make.bash in a cross-compiled configuration (for example, GOARCH different from GOHOSTARCH), cmd/go is installed to GOROOT/bin/GOOS_GOARCH instead of GOROOT/bin. That means that we need to look for GOROOT in both ../.. and ../../.., not just the former. Fixes #62144. Updates #62119. Updates #18678. Change-Id: I283c6a10c46df573ff44da826f870417359226a7 Reviewed-on: https://go-review.googlesource.com/c/go/+/521015 Reviewed-by: Michael Matloob <matloob@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 9e9556d328c53ed0a4d8b36feee949885d648ba8) Reviewed-on: https://go-review.googlesource.com/c/go/+/521695 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-30[release-branch.go1.21] encoding/xml: overriding by empty namespace when no ↵xuri
new name declaration The unmarshal and marshal XML text should be consistent if not modified deserialize variable. For #61881 Fixes #62051 Change-Id: I475f7b05211b618685597d3ff20b97e3bbeaf8f8 GitHub-Last-Rev: 6831c770c384831798cb1c6dc4674e5d4caa5e3c GitHub-Pull-Request: golang/go#58401 Reviewed-on: https://go-review.googlesource.com/c/go/+/522316 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Commit-Queue: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-08-25[release-branch.go1.21] encoding/gob: prevent panic from index out of range ↵Andy Pan
in Decoder.typeString I believe this bug is introduced by CL 460543 which optimizes the allocations by changing the type of `idToType` from map to slice, but didn't update the access code in `Decoder.typeString` that is safe for map but not for slice. For #62117 Fixes #62154 Change-Id: I0f2e4cc2f34c54dada1f83458ba512a6fde6dcbe Reviewed-on: https://go-review.googlesource.com/c/go/+/520757 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Andy Pan <panjf2000@gmail.com> Auto-Submit: Ian Lance Taylor <iant@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> (cherry picked from commit ba626ac327f45a6d9d211fddd5b48e321fa0702a) Reviewed-on: https://go-review.googlesource.com/c/go/+/521156 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
2023-08-25[release-branch.go1.21] runtime: fix maps.Clone bug when cloning a map mid-growKeith Randall
Fixes #62204 Change-Id: I0459d3f481b0cd20102f6d9fd3ea84335a7739a8 Reviewed-on: https://go-review.googlesource.com/c/go/+/522317 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit b303fb48558612e5c2a1f10acbc0b1accdb8f260) Reviewed-on: https://go-review.googlesource.com/c/go/+/522936 Reviewed-by: Carlos Amedee <carlos@golang.org>
2023-08-24[release-branch.go1.21] context: fix synchronization in ExampleAfterFunc_condBryan C. Mills
Condition variables are subtle and error-prone, and this example demonstrates exactly the sorts of problems that they introduce. Unfortunately, we're stuck with them for the foreseeable future. As previously implemented, this example was racy: since the callback passed to context.AfterFunc did not lock the mutex before calling Broadcast, it was possible for the Broadcast to occur before the goroutine was parked in the call to Wait, causing in a missed wakeup resulting in deadlock. The example also had a more insidious problem: it was not safe for multiple goroutines to call waitOnCond concurrently, but the whole point of using a sync.Cond is generally to synchronize concurrent goroutines. waitOnCond must use Broadcast to ensure that it wakes up the target goroutine, but the use of Broadcast in this way would produce spurious wakeups for all of the other goroutines waiting on the same condition variable. Since waitOnCond did not recheck the condition in a loop, those spurious wakeups would cause waitOnCond to spuriously return even if its own ctx was not yet done. Fixing the aforementioned bugs exposes a final problem, inherent to the use of condition variables in this way. This one is a performance problem: for N concurrent calls to waitOnCond, the resulting CPU cost is at least O(N²). This problem cannot be addressed without either reintroducing one of the above bugs or abandoning sync.Cond in the example entirely. Given that this example was already published in Go 1.21, I worry that Go users may think that it is appropriate to use a sync.Cond in conjunction with context.AfterFunc, so I have chosen to retain the Cond-based example and document its pitfalls instead of removing or replacing it entirely. I described this class of bugs and performance issues — and suggested some channel-based alternatives — in my GopherCon 2018 talk, “Rethinking Classical Concurrency Patterns”. The section on condition variables starts on slide 37. (https://youtu.be/5zXAHh5tJqQ?t=679) Fixes #62189. Updates #62180. For #20491. Change-Id: If987cd9d112997c56171a7ef4fccadb360bb79bc Reviewed-on: https://go-review.googlesource.com/c/go/+/521596 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> (cherry picked from commit 1081f8c05807728738e1e6bf9097a41796fe5a05) Reviewed-on: https://go-review.googlesource.com/c/go/+/521598
2023-08-24[release-branch.go1.21] go/types, types2: disable interface inference for ↵Robert Griesemer
versions before Go 1.21 Change the internal constant enableInterfaceInference to a unifier field that can be controlled dynamically and set it for Go 1.21 or later. This restores Go 1.20 unification behavior for interfaces. Fixes #61930. Change-Id: Iefd6c0899811f8208a8be9cef2650a07787ae177 Reviewed-on: https://go-review.googlesource.com/c/go/+/519855 Reviewed-by: Robert Findley <rfindley@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/520601
2023-08-24[release-branch.go1.21] cmd/compile: in expandCalls, move all arg ↵David Chase
marshalling into call block For aggregate-typed arguments passed to a call, expandCalls decomposed them into parts in the same block where the value was created. This is not necessarily the call block, and in the case where stores are involved, can change the memory leaving that block, and getting that right is problematic. Instead, do all the expanding in the same block as the call, which avoids the problems of (1) not being able to reorder loads/stores across a block boundary to conform to memory order and (2) (incorrectly, not) exposing the new memory to consumers in other blocks. Putting it all in the same block as the call allows reordering, and the call creates its own new memory (which is already dealt with correctly). Fixes #62057. Updates #61992. Change-Id: Icc7918f0d2dd3c480cc7f496cdcd78edeca7f297 Reviewed-on: https://go-review.googlesource.com/c/go/+/519276 Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit e72ecc6a6becab9ca895c0108047db4723394296) Reviewed-on: https://go-review.googlesource.com/c/go/+/520058
2023-08-23[release-branch.go1.21] Revert "os: use handle based APIs to read ↵Bryan Mills
directories on windows" This reverts CL 452995. Reason for revert: caused os.File.ReadDir to fail on filesystems that do not support FILE_ID_BOTH_DIR_INFO. This is an alternative to a fix-forward change in CL 518196. Since the original change was mostly a performance improvement, reverting to the previous implementation seems less risky than backporting a larger fix. Fixes #61910 Fixes #61964 Change-Id: I60f1602b9eb6ea353e7eb23429f19f1ffa16b394 Reviewed-on: https://go-review.googlesource.com/c/go/+/520156 Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
2023-08-23[release-branch.go1.21] Revert "cmd/compile: omit redundant sign/unsign ↵Keith Randall
extension on arm64" This reverts CL 427454. Reason for revert: causes incorrect generated code in some rare cases We'll fix-forward at tip, so the revert just needs to be done for 1.21. Fixes #62143 Change-Id: Id242230481ff4d4ba5f58236c6d8237729fc3b80 Reviewed-on: https://go-review.googlesource.com/c/go/+/520976 Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Ruinan Sun <Ruinan.Sun@arm.com> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2023-08-23[release-branch.go1.21] path/filepath: don't drop .. elements when cleaning ↵Damien Neil
invalid Windows paths Fix a bug where Clean could improperly drop .. elements from a path on Windows, when the path contains elements containing a ':'. For example, Clean("a/../b:/../../c") now correctly returns "..\c" rather than "c". For #61866. Fixes #61868. Change-Id: I97b0238953c183b2ce19ca89c14f26700008ea72 Reviewed-on: https://go-review.googlesource.com/c/go/+/517216 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Quim Muntal <quimmuntal@gmail.com> (cherry picked from commit 6e43407931ee4acc204620a9fae59c7903164901) Reviewed-on: https://go-review.googlesource.com/c/go/+/519655 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2023-08-23[release-branch.go1.21] cmd/link: don't mangle string symbol namesCherry Mui
String symbol names could contain weird characters as we put the string literal into the symbol name. So it may appear to need mangling. However, as string symbols are grouped into a single "go:string.*" symbol, the individual symbol names actually don't matter. So don't mangle them. Also make the mangling code more defensive in case of weird symbol names. Updates #62098. Fixes #62140. Change-Id: I533012567a9fffab69debda934f426421c7abb04 Reviewed-on: https://go-review.googlesource.com/c/go/+/520856 Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit b65e34f03814889f0edd3ddd9778864762511443) Reviewed-on: https://go-review.googlesource.com/c/go/+/520857
2023-08-18[release-branch.go1.21] runtime/internal/wasitest: skip racy TCP echo testChris O'Hara
The wasip1 TCP echo test introduced in CL 493358 has a race condition with port selection. The test runner probes for a free port and then asks the WASM runtime to listen on the port, which may be taken by another process in the interim. Due to limitations with WASI preview 1, the guest is unable to query the port it's listening on. The test cannot ask the WASM runtime to listen on port 0 (choose a free port) since there's currently no way for the test to query the selected port and connect to it. Given the race condition is unavoidable, this test is now disabled by default and requires opt-in via an environment variable. This commit also eliminates the hard-coded connection timeout. Updates #61820. Fixes #61821. Change-Id: I375145c1a1d03ad45c44f528da3347397e6dcb01 Reviewed-on: https://go-review.googlesource.com/c/go/+/519895 Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> (cherry picked from commit 795e779610cd1ef8ad4c137c067a23ace1190115) Reviewed-on: https://go-review.googlesource.com/c/go/+/520955 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-17[release-branch.go1.21] runtime: mark traceEnabled and traceShuttingDown as ↵Mauri de Souza Meneguzzo
no:split This fixes a regression from CL 494181. The traceEnabled function splits the stack and is being called by reentersyscall that shouldn't call anything that splits the stack. Same with traceShuttingDown. For #61975 Fixes #61987 Change-Id: I5eca0ba74cfa6acb0259e8400b03c2093cd59dd1 GitHub-Last-Rev: 9e55ae9d7cc700de9757d32a7905127a349d973a GitHub-Pull-Request: golang/go#61981 Reviewed-on: https://go-review.googlesource.com/c/go/+/519055 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@google.com> (cherry picked from commit aa5d483f25e89f3bf399362ccc9a5b146cae5c79) Reviewed-on: https://go-review.googlesource.com/c/go/+/519495 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com>
2023-08-17[release-branch.go1.21] cmd/compile: ensure empty blocks in write barriers ↵Keith Randall
are marked unpreemptible Fixes #61958 Change-Id: I242ab77ad2f1ea1dad2d14ef756fa92f9378429f Reviewed-on: https://go-review.googlesource.com/c/go/+/518755 Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com>
2023-08-17[release-branch.go1.21] runtime: profiling on Darwin cannot use blocking readsDavid Chase
On Darwin (and assume also on iOS but not sure), notetsleepg cannot be called in a signal-handling context. Avoid this by disabling block reads on Darwin. An alternate approach was to add "sigNote" with a pipe-based implementation on Darwin, but that ultimately would have required at least one more linkname between runtime and syscall to avoid racing with fork and opening the pipe, so, not. Fixes #62019. Updates #61768. Change-Id: I0e8dd4abf9a606a3ff73fc37c3bd75f55924e07e Reviewed-on: https://go-review.googlesource.com/c/go/+/518836 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> (cherry picked from commit c6ee8e31e3e7b01da54d241ae5a8eed350ab0e9f) Reviewed-on: https://go-review.googlesource.com/c/go/+/519375 Reviewed-by: Austin Clements <austin@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-17[release-branch.go1.21] cmd/compile: make backingArrayPtrLen to return ↵Cuong Manh Le
typecheck-ed nodes Fixes #61909 Change-Id: Ief8e3a6c42c0644c9f71ebef5f28a294cd7c153f Reviewed-on: https://go-review.googlesource.com/c/go/+/517936 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/518115 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-17[release-branch.go1.21] go/types, types2: don't panic during interface ↵Robert Findley
completion It should be possible for the importer to construct an invalid interface, as would have been produced by type checking. Updates #61737 Fixes #61743 Change-Id: I72e063f4f1a6205d273a623acce2ec08c34c3cc2 Reviewed-on: https://go-review.googlesource.com/c/go/+/515555 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Findley <rfindley@google.com> Reviewed-by: Olif Oftimis <oftimisolif@gmail.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit d2ee7821d357a4e4948b9a6251e82b4ced9a1eae) Reviewed-on: https://go-review.googlesource.com/c/go/+/515636 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-17[release-branch.go1.21] go/types, types2: use correct parameter list when ↵Robert Griesemer
checking argument passing The existing code was simply wrong: we cannot ever use the result signature parameter list (rsig.params) if sigParams was adjusted for variadic functions. If it was adjusted, we always must either use sigParams or its separately instantiated version. In the condition "n > 0 && adjusted", the "n > 0" should have been in either of the respective "if statement" branches. Simplified the code by merging with the result signature parameter update. Fixes #61932. Change-Id: I5d39bc8bbc4dd85c7c985055d29532b4b176955e Reviewed-on: https://go-review.googlesource.com/c/go/+/519456 Auto-Submit: Robert Griesemer <gri@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/519417 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-17[release-branch.go1.21] go/types, types2: use exact unification when ↵Robert Griesemer
comparing interface methods Irrespective of whether unification is exact or inexact, method signatures of interfaces must always match exactly: a type never satisfies/implements an interface if relevant method signatures are different (i.e., not identical, possibly after substitution). Fixes #61959. Change-Id: I20c0aa28ac86e2edec615b40f2269938e4a96938 Reviewed-on: https://go-review.googlesource.com/c/go/+/519435 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/519416 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-17[release-branch.go1.21] cmd/api: rename api.go to main_test.goRuss Cox
This makes cmd/api no longer an importable package. In CL 453258 I forgot that there was no direct prohibition on importing packages from cmd - we just rely on the fact that cmd/* is all package main and everything else is cmd/internal. Fixes #62069. Fixes #62071. Change-Id: Ifed738d333b40663f85eca8f83025fcea5df89a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/520038 Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/520061
2023-08-16[release-branch.go1.21] crypto/tls: add GODEBUG to control max RSA key sizeRoland Shoemaker
Add a new GODEBUG setting, tlsmaxrsasize, which allows controlling the maximum RSA key size we will accept during TLS handshakes. Fixes #61967 Change-Id: I52f060be132014d219f4cd438f59990011a35c96 Reviewed-on: https://go-review.googlesource.com/c/go/+/517495 Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/518535 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-15[release-branch.go1.21] cmd/go: fix missing case checking for empty sliceMichael Matloob
When we were comparing the first element of import stacks when sorting depserrors we checked if the first stack was non empty, but not the second one. Do the check for both stacks. Fixes #61818 Updates #61816 For #59905 Change-Id: Id5c11c2b1104eec93196a08c53372ee2ba97c701 Reviewed-on: https://go-review.googlesource.com/c/go/+/516739 Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Matloob <matloob@golang.org> (cherry picked from commit 58447d757c233f2a9c3c5a73e2d96a6885f2759a) Reviewed-on: https://go-review.googlesource.com/c/go/+/519658 Reviewed-by: Michael Matloob <matloob@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2023-08-14[release-branch.go1.21] net/http: permit requests with invalid Host headersDamien Neil
Historically, the Transport has silently truncated invalid Host headers at the first '/' or ' ' character. CL 506996 changed this behavior to reject invalid Host headers entirely. Unfortunately, Docker appears to rely on the previous behavior. When sending a HTTP/1 request with an invalid Host, send an empty Host header. This is safer than truncation: If you care about the Host, then you should get the one you set; if you don't care, then an empty Host should be fine. Continue to fully validate Host headers sent to a proxy, since proxies generally can't productively forward requests without a Host. For #60374 Fixes #61431 Fixes #61904 Change-Id: If170c7dd860aa20eb58fe32990fc93af832742b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/511155 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Run-TryBot: Damien Neil <dneil@google.com> (cherry picked from commit b9153f6ef338baee5fe02a867c8fbc83a8b29dd1) Reviewed-on: https://go-review.googlesource.com/c/go/+/518856 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Roland Shoemaker <roland@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2023-08-11[release-branch.go1.21] cmd/distpack: include directory entries in tar filesRuss Cox
Various tools expect tar files to contain entries for directories. I dropped them when writing cmd/distpack because they're not strictly necessary and omitting them saves space, but it also turns out to break some things, so add them back. We will backport this to release-branch.go1.21 so that Go 1.21.1 will include the directory entries. We can't do anything about Go 1.21.0 retroactively. % tar tzvf go1.22rsc1.src.tar.gz | sed 10q drwxr-xr-x 0 0 0 0 Aug 10 10:07 go/ -rw-r--r-- 0 0 0 1337 Aug 10 10:07 go/CONTRIBUTING.md -rw-r--r-- 0 0 0 1479 Aug 10 10:07 go/LICENSE -rw-r--r-- 0 0 0 1303 Aug 10 10:07 go/PATENTS -rw-r--r-- 0 0 0 1455 Aug 10 10:07 go/README.md -rw-r--r-- 0 0 0 419 Aug 10 10:07 go/SECURITY.md -rw-r--r-- 0 0 0 42 Aug 10 10:07 go/VERSION drwxr-xr-x 0 0 0 0 Aug 10 10:07 go/api/ -rw-r--r-- 0 0 0 1142 Aug 10 10:07 go/api/README -rw-r--r-- 0 0 0 35424 Aug 10 10:07 go/api/except.txt % tar tzvf go1.22rsc1.darwin-amd64.tar.gz | sed 10q drwxr-xr-x 0 0 0 0 Aug 10 10:07 go/ -rw-r--r-- 0 0 0 1337 Aug 10 10:07 go/CONTRIBUTING.md -rw-r--r-- 0 0 0 1479 Aug 10 10:07 go/LICENSE -rw-r--r-- 0 0 0 1303 Aug 10 10:07 go/PATENTS -rw-r--r-- 0 0 0 1455 Aug 10 10:07 go/README.md -rw-r--r-- 0 0 0 419 Aug 10 10:07 go/SECURITY.md -rw-r--r-- 0 0 0 42 Aug 10 10:07 go/VERSION drwxr-xr-x 0 0 0 0 Aug 10 10:07 go/api/ -rw-r--r-- 0 0 0 1142 Aug 10 10:07 go/api/README -rw-r--r-- 0 0 0 35424 Aug 10 10:07 go/api/except.txt % Fixes #61862. Fixes #61927. Change-Id: Iecd9ba893015295e88715b031b79a104236b9ced Reviewed-on: https://go-review.googlesource.com/c/go/+/518335 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/518835 Auto-Submit: Russ Cox <rsc@golang.org>
2023-08-11[release-branch.go1.21] cmd/go/internal/web: release the net token when an ↵Bryan C. Mills
HTTP request fails due to CheckRedirect Updates #61877. Fixes #61905. Change-Id: I38c63565aaf9dc9b0c8085974521daccfbcbc790 Reviewed-on: https://go-review.googlesource.com/c/go/+/518015 Reviewed-by: Michael Matloob <matloob@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 8cb5c55118a8273e1cc605b8ba167297808c4eda) Reviewed-on: https://go-review.googlesource.com/c/go/+/518395
2023-08-11[release-branch.go1.21] cmd/compile: fix missing init nodes for ↵Cuong Manh Le
len(string([]byte)) optimization CL 497276 added optimization for len(string([]byte)) by avoiding call to slicebytetostring. However, the bytes to string expression may contain init nodes, which need to be preserved. Otherwise, it would make the liveness analysis confusing about the lifetime of temporary variables created by init nodes. Fixes #61781 Change-Id: I6d1280a7d61bcc75f11132af41bda086f084ab54 Reviewed-on: https://go-review.googlesource.com/c/go/+/516375 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/516535
2023-08-08[release-branch.go1.21] go1.21.0go1.21.0Gopher Robot
Change-Id: Iffac2ce43cd3a48ba420594adc3eab5aa9bcf113 Reviewed-on: https://go-review.googlesource.com/c/go/+/517055 Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com> Auto-Submit: Michael Knyszek <mknyszek@google.com>
2023-08-04[release-branch.go1.21] Revert "net/http: use Copy in ServeContent if CopyN ↵Damien Neil
not needed" This reverts CL 446276. Reason for revert: Causing surprising performance regression. Fixes #61530 Change-Id: Ic970f2e05d875b606ce274ea621f7e4c8c337481 Reviewed-on: https://go-review.googlesource.com/c/go/+/512615 Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit df0a1297899aff1c46b66523e75aa12b0ff5049f) Reviewed-on: https://go-review.googlesource.com/c/go/+/515795 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Damien Neil <dneil@google.com>
2023-08-03[release-branch.go1.21] spec: remove unnecessary sentenceRobert Griesemer
Change-Id: I06345199ff16c80be83c345d734caef1714ec089 Reviewed-on: https://go-review.googlesource.com/c/go/+/515338 TryBot-Bypass: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/515715
2023-08-03[release-branch.go1.21] runtime/internal: switch GOWASIRUNTIME defaultJohan Brandhorst-Satzkorn
CL 513235 switched the default wasip1 runtime in the misc/wasm executable script, but it missed this use of the GOWASIRUNTIME environment variable. Update this instance to make the default runtime choice consistent. Change-Id: Iff7f96231422747a38d65d13a940f6e9d04d835d Reviewed-on: https://go-review.googlesource.com/c/go/+/515116 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
2023-08-02[release-branch.go1.21] crypto/tls: change SendSessionTicket to take an ↵Damien Neil
options struct To allow for future evolution of the API, make QUICConn.SendSessionTicket take a QUICSessionTicketOptions rather than a single bool. For #60107 Change-Id: I798fd0feec5c7581e3c3574e2de99611c81df47f Reviewed-on: https://go-review.googlesource.com/c/go/+/514997 Reviewed-by: Roland Shoemaker <roland@golang.org> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Marten Seemann <martenseemann@gmail.com> (cherry picked from commit a915b999c915eb7827396013bcb334747863e66e) Reviewed-on: https://go-review.googlesource.com/c/go/+/515335 Auto-Submit: Damien Neil <dneil@google.com>
2023-08-02[release-branch.go1.21] cmd/link: use symbol-targeted relocation for ↵Cherry Mui
initializers on Mach-O Apple's new linker, ld-prime from Xcode 15 beta, when handling initializers in __mod_init_func, drops the offset in the data, resolving the relocation to the beginning of the section. The latest version of ld-prime rejects non-zero addend. We need to use symbol-targeted "external" relocations, so that it doesn't need an addend and can be resolved correctly. This also works fine with ld64. Fixes #60694. For #61229. Change-Id: Ida2be6aa4c91bfcd142b755e2ec63aabfbbd77a6 Reviewed-on: https://go-review.googlesource.com/c/go/+/502616 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit bad9ca8a612f6fae85cfc25e07e69ed30384fc84) Reviewed-on: https://go-review.googlesource.com/c/go/+/514535
2023-08-02[release-branch.go1.21] cmd/go: missing name in failed command errorMauri de Souza Meneguzzo
Fixed the error reporting for an unknown command to preserve the name when displaying the error message. Fixes #61604 Change-Id: I13defb84e61265ab48ab514e9d4f1626a4a3f758 GitHub-Last-Rev: 5d2889c60ceb3f43bb63b6641ecbcca08b7cd365 GitHub-Pull-Request: golang/go#61607 Reviewed-on: https://go-review.googlesource.com/c/go/+/513555 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/515278 Auto-Submit: David Chase <drchase@google.com>
2023-08-02[release-branch.go1.21] go1.21rc4go1.21rc4Gopher Robot
Change-Id: I4a166f3d04747703f2c0b3c3f245d9cde44f3068 Reviewed-on: https://go-review.googlesource.com/c/go/+/514777 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Gopher Robot <gobot@golang.org> Auto-Submit: Gopher Robot <gobot@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
2023-08-01[release-branch.go1.21] crypto/tls: restrict RSA keys in certificates to <= ↵Roland Shoemaker
8192 bits Extremely large RSA keys in certificate chains can cause a client/server to expend significant CPU time verifying signatures. Limit this by restricting the size of RSA keys transmitted during handshakes to <= 8192 bits. Based on a survey of publicly trusted RSA keys, there are currently only three certificates in circulation with keys larger than this, and all three appear to be test certificates that are not actively deployed. It is possible there are larger keys in use in private PKIs, but we target the web PKI, so causing breakage here in the interests of increasing the default safety of users of crypto/tls seems reasonable. Thanks to Mateusz Poliwczak for reporting this issue. Updates #61460 Fixes CVE-2023-29409 Change-Id: Ie35038515a649199a36a12fc2c5df3af855dca6c Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1912161 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Run-TryBot: Roland Shoemaker <bracewell@google.com> (cherry picked from commit d865c715d92887361e4bd5596e19e513f27781b7) Reviewed-on: https://go-review.googlesource.com/c/go/+/515056 Run-TryBot: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2023-08-01[release-branch.go1.21] cmd/go: make go list -m -u all not complain about ↵Russ Cox
missing checksums This is a band-aid of a fix for Go 1.21, to create space to work on a real fix for Go 1.22, if in fact the real fix is different. It simply disables the go.sum update check during go list -m -u. I don't have a self-contained test for the breakage. See #61605. All existing tests continue to pass. For #61605. After merging into the Go 1.21 branch we can move #61605 to the Go 1.22 milestone. Change-Id: Ib155710092003f08d2a6ce0aefa8e0270cad5a5c Reviewed-on: https://go-review.googlesource.com/c/go/+/514899 Reviewed-by: Michael Matloob <matloob@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2023-07-31[release-branch.go1.21] misc/wasm: switch default WASI runtimeJohan Brandhorst-Satzkorn
The default WASI runtime was originally set to Wazero, because it was the first runtime used to test the Go implementation and because we could easily find and fix issues in our implementation and theirs. In CL 498675 we switched the default wasip1 runner to Wasmtime as it runs faster and is a more established and mature runtime. We should switch the default runtime to Wasmtime to consistently promote Wasmtime as the primary tested and approved runtime. Change-Id: Ic6c064142321af90f015e02b7fe0e71444d8842c Reviewed-on: https://go-review.googlesource.com/c/go/+/513235 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Eli Bendersky <eliben@google.com> Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Auto-Submit: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> (cherry picked from commit 4918490962ebda2b055bd1d160af9e9daa529522) Reviewed-on: https://go-review.googlesource.com/c/go/+/514155 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: David Chase <drchase@google.com>
2023-07-31[release-branch.go1.21] spec: update spec to version at tipRobert Griesemer
This updates the spec by copying over several recent CLs describing the new type inference mechanisms. Fixes #61659. Change-Id: I750c901e73e0404f782a3632f5cd936e3775ae13 Reviewed-on: https://go-review.googlesource.com/c/go/+/514435 Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> TryBot-Bypass: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2023-07-31[release-branch.go1.21 cmd/cgo/internal/test: don't pass -lm on darwinCherry Mui
On darwin, -lm is not necessary as the math functions are included in libSystem. Passing -lm multiple times results in linker warnings. Don't pass it on darwin. For #61229. Change-Id: I72d8dab1f0eead68cbeb176ac97b8ed1a0cfddab Reviewed-on: https://go-review.googlesource.com/c/go/+/508697 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 333c80694c797b5540c959f33c710bc6eba0d141) Reviewed-on: https://go-review.googlesource.com/c/go/+/513758
2023-07-28[release-branch.go1.21] cmd/dist: handle -json flag in runPending (minimal)Dmitri Shuralyov
The -json flag is new to Go 1.21, but missed skips in runPending. This CL adds minimal code to fix that. CL 512115 cleans up a bit. For #37486. Fixes #61557. Change-Id: I53e426c9a5585b2703f0ff6661a0470e1993f960 Reviewed-on: https://go-review.googlesource.com/c/go/+/513761 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>