aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-09-05[release-branch.go1.22] go1.22.7go1.22.7Gopher Robot
Change-Id: I48927705dee7f707ada7d3536d63da24541102fa Reviewed-on: https://go-review.googlesource.com/c/go/+/611197 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Commit-Queue: Gopher Robot <gobot@golang.org> Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com>
2024-09-05[release-branch.go1.22] go/build/constraint: add parsing limitsRoland Shoemaker
Limit the size of build constraints that we will parse. This prevents a number of stack exhaustions that can be hit when parsing overly complex constraints. The imposed limits are unlikely to ever be hit in real world usage. Updates #69141 Fixes #69148 Fixes CVE-2024-34158 Change-Id: I38b614bf04caa36eefc6a4350d848588c4cef3c4 Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1540 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Russ Cox <rsc@google.com> (cherry picked from commit 0c74dc9e0da0cf1e12494b514d822b5bebbc9f04) Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1582 Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/611183 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com>
2024-09-05[release-branch.go1.22] encoding/gob: cover missed cases when checking ↵Roland Shoemaker
ignore depth This change makes sure that we are properly checking the ignored field recursion depth in decIgnoreOpFor consistently. This prevents stack exhaustion when attempting to decode a message that contains an extremely deeply nested struct which is ignored. Thanks to Md Sakib Anwar of The Ohio State University (anwar.40@osu.edu) for reporting this issue. Updates #69139 Fixes #69144 Fixes CVE-2024-34156 Change-Id: Iacce06be95a5892b3064f1c40fcba2e2567862d6 Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1440 Reviewed-by: Russ Cox <rsc@google.com> Reviewed-by: Damien Neil <dneil@google.com> (cherry picked from commit f0a11f9b3aaa362cb1d05e095e3c8d421d4f087f) Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1580 Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/611182 TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-09-05[release-branch.go1.22] go/parser: track depth in nested element listsRoland Shoemaker
Prevents stack exhaustion with extremely deeply nested literal values, i.e. field values in structs. Updates #69138 Fixes #69142 Fixes CVE-2024-34155 Change-Id: I2e8e33b44105cc169d7ed1ae83fb56df0c10f1ee Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1520 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Russ Cox <rsc@google.com> (cherry picked from commit eb1b038c0d01761694e7a735ef87ac9164c6568e) Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1561 Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/611181 Reviewed-by: Michael Pratt <mpratt@google.com> TryBot-Bypass: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-08-21[release-branch.go1.22] runtime: on AIX, fix call to _cgo_sys_thread_create ↵Paul E. Murphy
in _rt0_ppc64_aix_lib The AIX ABI requires allocating parameter save space when calling a function, even if the arguments are passed via registers. gcc sometimes uses this space. In the case of the cgo c-archive tests, it clobbered the storage space of argc/argv which prevented the test program from running the expected test. Fixes #68972 Change-Id: I8a267b463b1abb2b37ac85231f6c328f406b7515 Reviewed-on: https://go-review.googlesource.com/c/go/+/606895 Reviewed-by: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Paul Murphy <murp@ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/607175 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-08-21[release-branch.go1.22] cmd/fix: support go versions with patch releaseAlex Bozhenko
Support go version with patch release(e.g. 1.21.0) and release candidates(e.g. 1.21rc1) when parsing the go version in the fix command by using new "go/version" package. For #62584. Fixes #68825. Change-Id: I0ec16137c7a396c68039d374c770c4021fb54b4e GitHub-Last-Rev: 76bced5c48334c0937289bce8bcf50f82e3f0b98 GitHub-Pull-Request: golang/go#62586 Reviewed-on: https://go-review.googlesource.com/c/go/+/527342 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Russ Cox <rsc@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Alex Bozhenko <alexbozhenko@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com> (cherry picked from commit 7fd62ba821b1044e8e4077df052b0a1232672d57) Reviewed-on: https://go-review.googlesource.com/c/go/+/603981 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Bypass: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Kirill Kolyshkin <kolyshkin@gmail.com>
2024-08-14[release-branch.go1.22] os: fix Chtimes test flakesKir Kolyshkin
It appears that some builders (notably, linux-arm) have some additional security software installed, which apparently reads the files created by tests. As a result, test file atime is changed, making the test fail like these: === RUN TestChtimesOmit ... os_test.go:1475: atime mismatch, got: "2024-07-30 18:42:03.450932494 +0000 UTC", want: "2024-07-30 18:42:02.450932494 +0000 UTC" === RUN TestChtimes ... os_test.go:1539: AccessTime didn't go backwards; was=2024-07-31 20:45:53.390326147 +0000 UTC, after=2024-07-31 20:45:53.394326118 +0000 UTC According to inode(7), atime is changed when more than 0 bytes are read from the file. So, one possible solution to these flakes is to make the test files empty, so no one can read more than 0 bytes from them. For #68687 For #68663 Fixes #68811 Change-Id: Ib9234567883ef7b16ff8811e3360cd26c2d6bdab Reviewed-on: https://go-review.googlesource.com/c/go/+/604315 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Kirill Kolyshkin <kolyshkin@gmail.com> Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Commit-Queue: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> (cherry picked from commit 84266e1469cfa6fa8e1b41518528a96950db7562) Reviewed-on: https://go-review.googlesource.com/c/go/+/605375 Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-08-06[release-branch.go1.22] go1.22.6go1.22.6Gopher Robot
Change-Id: I44f2d95946993adffabc021347afdc41ca974ccd Reviewed-on: https://go-review.googlesource.com/c/go/+/603416 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Gopher Robot <gobot@golang.org>
2024-07-31[release-branch.go1.22] cmd/compile: add 0-sized-value simplification to ↵David Chase
copyelim The problem was caused by faulty handling of unSSA-able operations on zero-sized data in expand calls, but there is no point to operations on zero-sized data. This CL adds a simplify step to the first place in SSA where all values are processed and replaces anything producing a 0-sized struct/array with the corresponding Struct/Array Make0 operation (of the appropriate type). I attempted not generating them in ssagen, but that was a larger change, and also had bugs. This is simple and obvious. The only question is whether it would be worthwhile to do it earlier (in numberlines or phielem). Fixes #68594. Fixes #68585. Change-Id: I0a596b3d272798015e7bb6b1a20411241759fe0e Reviewed-on: https://go-review.googlesource.com/c/go/+/568258 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 6f5d77454e31be8af11a7e2bcda36d200fda07c5) Reviewed-on: https://go-review.googlesource.com/c/go/+/601195
2024-07-24[release-branch.go1.22] cmd/trace/v2: make the -pprof actually usefulMichael Anthony Knyszek
In both the v1 and v2 cmd/trace, pprofMatchingGoroutines will generate no output at all if the filter name passed to it is the empty string. This is rather pointless because there are at least two places where we don't pass a name to filter. Modify pprofMatchingGoroutines to include *all* goroutines in the trace if the name to filter by is not specified. For #66782 Fixes #68542 Fixes #68546 Change-Id: I6b72298d676bc93892b075a7426e6e56bc6656c7 Reviewed-on: https://go-review.googlesource.com/c/go/+/578356 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Carlos Amedee <carlos@golang.org> Auto-Submit: Michael Knyszek <mknyszek@google.com> (cherry picked from commit d1f2cd8a4968d618caf6757ac648d80f2733e5cb) Reviewed-on: https://go-review.googlesource.com/c/go/+/600275 Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-07-24[release-branch.go1.22] cmd/trace/v2: handle the -pprof flagMichael Anthony Knyszek
Turns out we ported all the profile generation, but forgot to actually support the command line flags for them! This change fixes the issue by handling the different kinds of profiles and writing them out to stdout. For #66782 For #68542 For #68546 Change-Id: I7756fb4636ce8daaf11ed471be79c86ce3d463cc Reviewed-on: https://go-review.googlesource.com/c/go/+/578318 Reviewed-by: Carlos Amedee <carlos@golang.org> Auto-Submit: Michael Knyszek <mknyszek@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit e14aad1faf6f511e342d124681bc0146e426f9aa) Reviewed-on: https://go-review.googlesource.com/c/go/+/600255 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2024-07-17[release-branch.go1.22] cmd/internal/cov: close counter data files eagerlyThan McIntosh
When reading the counter data files from a given pod, close the underlying *os.File immediately after each one is read, as opposed to using a deferred close in the loop (which will close them all at the end of the function). Doing things this way avoids running into "too many open files" when processing large clumps of counter data files. Fixes #68492. Updates #68468. Change-Id: Ic1fe1d36c44d3f5d7318578cd18d0e65465d71d9 Reviewed-on: https://go-review.googlesource.com/c/go/+/598735 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 355711821eea51c6456a31ab61d0dc2e9db034f7) Reviewed-on: https://go-review.googlesource.com/c/go/+/599036
2024-07-17[release-branch.go1.22] internal/bytealg: extend memchr result correctly on wasmZxilly
The mem address should be regarded as uint32. Fixes #68475 Change-Id: Icee38d11f2d93eeca7d50b2e133159e321daeb90 GitHub-Last-Rev: c2568b104369bcf5c4d42c6281d235a52bb9675f GitHub-Pull-Request: golang/go#68400 Reviewed-on: https://go-review.googlesource.com/c/go/+/597955 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 90c6558b6acef5a9b9fb8f3c35cff58423c8b00e) Reviewed-on: https://go-review.googlesource.com/c/go/+/598975
2024-07-16[release-branch.go1.22] go/types: fix assertion failure when range over int ↵Tim King
is not permitted Fixes an assertion failure in Checker.rangeStmt that range over int only has a key type and no value type. When allowVersion failed, rangeKeyVal returns Typ[Invalid] for the value instead of nil. When Config.Error != nil, rangeStmt proceeded. The check for rhs[1]==nil was not enough to catch this case. It must also check rhs[1]== Fixes #68334 Fixes #68370 Change-Id: Iffa1b2f7b6a94570ec50b8c6603e727a45ba3357 Reviewed-on: https://go-review.googlesource.com/c/go/+/597356 Reviewed-by: Robert Findley <rfindley@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 4e77872d16340595d76b905fe24369b76cfd1b5f) Reviewed-on: https://go-review.googlesource.com/c/go/+/598055
2024-07-10[release-branch.go1.22] cmd/link: don't let dsymutil delete our temp directoryCherry Mui
To work around #59026, where dsymutil may not clean up its temp directory at exit, we set DSYMUTIL_REPRODUCER_PATH to our temp directory so it uses that, and we can delete it at the end. In Xcode 16 beta, dsymutil deletes the DSYMUTIL_REPRODUCER_PATH directory even if it is not empty. We still need our tmpdir at the point, so give a subdirectory to dsymutil instead. Updates #68088. Fixes #68198. Change-Id: I18759cc39512819bbd0511793ce917eae72245d6 Reviewed-on: https://go-review.googlesource.com/c/go/+/593659 Reviewed-by: Than McIntosh <thanm@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 5f319b75075a62ab176ab8c25f0e45f2ae4f0704) Reviewed-on: https://go-review.googlesource.com/c/go/+/596455
2024-07-10[release-branch.go1.22] cmd/compile: don't elide zero extension on top of ↵Keith Randall
signed values v = ... compute some value, which zeros top 32 bits ... w = zero-extend v We want to remove the zero-extension operation, as it doesn't do anything. But if v is typed as a signed value, and it gets spilled/restored, it might be re-sign-extended upon restore. So the zero-extend isn't actually a NOP when there might be calls or other reasons to spill in between v and w. Fixes #68230 Change-Id: I3b30b8e56c7d70deac1fb09d2becc7395acbadf8 Reviewed-on: https://go-review.googlesource.com/c/go/+/595675 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Joedian Reid <joedian@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> (cherry picked from commit 7f90b960a9711b51bf36f49be4274ac5f7e86a95) Reviewed-on: https://go-review.googlesource.com/c/go/+/595696 Reviewed-by: Keith Randall <khr@google.com>
2024-07-10[release-branch.go1.22] cmd/go: fix build config before creating actions for ↵Ehden Sinai
'go list -cover' When -covermode is set to atomic, instrumented packages need to import sync/atomic. If this is not already imported by a package being instrumented, the build needs to ensure that sync/atomic is compiled whenever 'go list' is run in a way that triggers package builds. The build config was already being made to ensure the import, but only after the action graph had been created, so there was no guarantee that sync/atomic would be built when needed. For #65264. For #68212 Fixes #68222 Change-Id: Ib3f1e102ce2ef554ea08330d9db69a8c98790ac5 Reviewed-on: https://go-review.googlesource.com/c/go/+/560236 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> (cherry picked from commit ac08c05d4daa11957fcada6db33f2150936bac27) Reviewed-on: https://go-review.googlesource.com/c/go/+/595496 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Than McIntosh <thanm@google.com>
2024-07-10[release-branch.go1.22] os/exec: only use cachedLookExtensions if Cmd.Path ↵Dmitri Shuralyov
is unmodified Caching the invocation of lookExtensions on an absolute path in Command and reusing the cached result in Start is only viable if Cmd.Path isn't set to a different value after Command returns. For #66586. For #68314. Fixes #68331. Change-Id: I57007850aca2011b11344180c00faded737617b5 Reviewed-on: https://go-review.googlesource.com/c/go/+/596875 Reviewed-by: qiu laidongfeng2 <2645477756@qq.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> (cherry picked from commit d0146bd85bb6870aa43a498b06ccb473af55cbe3) Reviewed-on: https://go-review.googlesource.com/c/go/+/596976
2024-07-02[release-branch.go1.22] go1.22.5go1.22.5Gopher Robot
Change-Id: Ibc28cd85275c5a1c943b0d052b6adc4425ab5165 Reviewed-on: https://go-review.googlesource.com/c/go/+/596255 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com> Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2024-06-26[release-branch.go1.22] cmd/link: handle dynamic import variables on Darwin ↵Cherry Mui
in plugin mode CL 501855 added support for cgo_dynamic_import variables on Darwin. But it didn't support the plugin build mode on amd64, where the assembler turns a direct load (R_PCREL) to a load via GOT (R_GOTPCREL). This CL adds the support. We just need to handle external linking mode, as this can only occur in plugin or shared build mode, which requires external linking. Fixes #68122. Updates #67976. Updates #50891. Change-Id: I0f56265d50bfcb36047fa5538ad7a5ec77e7ef96 Reviewed-on: https://go-review.googlesource.com/c/go/+/592499 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 44f18706661db8b865719d15a5cfa0515d1a4fca) Reviewed-on: https://go-review.googlesource.com/c/go/+/595175 Reviewed-by: Joedian Reid <joedian@google.com> Reviewed-by: Than McIntosh <thanm@google.com>
2024-06-26[release-branch.go1.22] net/http: send body or close connection on ↵Damien Neil
expect-100-continue requests When sending a request with an "Expect: 100-continue" header, we must send the request body before sending any further requests on the connection. When receiving a non-1xx response to an "Expect: 100-continue" request, send the request body if the connection isn't being closed after processing the response. In other words, if either the request or response contains a "Connection: close" header, then skip sending the request body (because the connection will not be used for further requests), but otherwise send it. Correct a comment on the server-side Expect: 100-continue handling that implied sending the request body is optional. It isn't. For #67555 Fixes #68200 Change-Id: Ia2f12091bee697771087f32ac347509ec5922d54 Reviewed-on: https://go-review.googlesource.com/c/go/+/591255 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com> (cherry picked from commit cf501e05e138e6911f759a5db786e90b295499b9) Reviewed-on: https://go-review.googlesource.com/c/go/+/595235 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Joedian Reid <joedian@google.com>
2024-06-26[release-branch.go1.22] cmd/compile: mark pointer to noalg type as noalgzuojunwei.1024
When the compiler writes PtrToThis field of noalg type, it generates its pointer type. Mark them as noalg to prevent put them in typelinks. Fixes #65983 Change-Id: Icbc3b18bc866f9138c7648e42dd500a80326f72b Reviewed-on: https://go-review.googlesource.com/c/go/+/567335 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@google.com> (cherry picked from commit b8c76effd9a3a30d66e44ed7acea789e4e95b926) Reviewed-on: https://go-review.googlesource.com/c/go/+/593876 Reviewed-by: David Chase <drchase@google.com>
2024-06-24[release-branch.go1.22] os/exec: on Windows look for extensions in Run if ↵qiulaidongfeng
not already done CL 512155 fixed #36768, but introduced #62596. CL 527820 fixed #62596, but meant that the code failed to look up file extensions on Windows for a relative path. This CL fixes that problem by recording whether it has already looked up file extensions. This does mean that if Path is set manually then we do not update it with file extensions, as doing that would be racy. For #66586 Fixes #66598 Change-Id: I9a0305d1e466c5e07bfbe442566ea12f5255a96e GitHub-Last-Rev: dc3169f2350f61acac5ef7842b7514013abacbe1 GitHub-Pull-Request: golang/go#67035 Reviewed-on: https://go-review.googlesource.com/c/go/+/581695 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> (cherry picked from commit 5532427c4b1c5e962ad5484258be0071bd270e53) Reviewed-on: https://go-review.googlesource.com/c/go/+/594495 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Commit-Queue: Ian Lance Taylor <iant@google.com>
2024-06-24[release-branch.go1.22] runtime: always update stack bounds on cgocallbackMichael Pratt
callbackUpdateSystemStack contains a fast path to exit early without update if SP is already within the g0.stack bounds. This is not safe, as a subsequent call may have new stack bounds that only partially overlap the old stack bounds. In this case it is possible to see an SP that is in the old stack bounds, but very close to the bottom of the bounds due to the partial overlap. In that case we're very likely to "run out" of space on the system stack. We only need to do this on extra Ms, as normal Ms have precise bounds defined when we allocated the stack. TSAN annotations are added to x_cgo_getstackbounds because bounds is a pointer into the Go stack. The stack can be reused when an old thread exits and a new thread starts, but TSAN can't see the synchronization there. This isn't a new case, but we are now calling more often. For #62440. Fixes #67298. Cq-Include-Trybots: luci.golang.try:go1.22-linux-amd64-longtest Change-Id: I5389050494987b7668d0b317fb92f85e61d798ac Reviewed-on: https://go-review.googlesource.com/c/go/+/584597 Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 1ffc296717ba27d5ca5dd9a81439a49367363c89) Reviewed-on: https://go-review.googlesource.com/c/go/+/585935 Run-TryBot: Joedian Reid <joedian@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2024-06-24[release-branch.go1.22] cmd/compile: put constants before variables in ↵Keith Randall
initialization order Fixes #67820. Change-Id: I03f4d4577b88ad0a92b260b2efd0cb9fe5082b2f Reviewed-on: https://go-review.googlesource.com/c/go/+/575075 Reviewed-by: Robert Griesemer <gri@google.com> Reviewed-by: Keith Randall <khr@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/590395 Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Keith Randall <khr@golang.org>
2024-06-24[release-branch.go1.22] go/types, types2: report error for floating-point ↵Robert Griesemer
iteration variable While at it, slightly improve documentation and code. Also, add additional test cases for #66561. Updates #66561. Fixes #67798. Change-Id: I682b0e9227e065d6bbd199871c2e1ecff13edc66 Reviewed-on: https://go-review.googlesource.com/c/go/+/580937 Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Robert Findley <rfindley@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/590056
2024-06-24[release-branch.go1.22] crypto/tls: don't call tlsrsakex.IncNonDefault with FIPSMike Beaumont
We haven't called tlsrsakex.Value() yet at this point if we're using FIPS, like if CipherSuites != nil. This adds needFIPS as a gate next to CipherSuites != nil. FIPS specifies suites that would be skipped if tlsarsakex were set. For #65991. Fixes #65994. Change-Id: I8070d8f43f27c04067490af8cc7ec5e787f2b9bd Reviewed-on: https://go-review.googlesource.com/c/go/+/582315 Reviewed-by: Filippo Valsorda <filippo@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Bypass: Filippo Valsorda <filippo@golang.org> Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> (cherry picked from commit 78e50d0fa0bc78d197bd1b41e1bdef8c20a03396) Reviewed-on: https://go-review.googlesource.com/c/go/+/593395 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
2024-06-24[release-branch.go1.22] cmd/cgo/internal/swig: force use of lld for LTO ↵Michael Anthony Knyszek
tests on the builders For whatever reason, on the builders, when using /usr/bin/ld (the default linker) with -flto we end up with problems. Specifically, the linker seems to require LLVMgold.so and can't find it. I'm not really sure why, but what definitely seems to work is forcing use of lld, which ships with our clang installation on the builders. Just enforce this on the builders for now; I've actually had very few problems running this locally (and I think I'm also mixing and matching linkers and toolchains too...), so it may be related to the version of clang we're testing with. For #67698. For #67715. Change-Id: I3bfbcd609e7d0fd70e52ac7e2a0817db95664f20 Cq-Include-Trybots: luci.golang.try:go1.22-linux-amd64-clang15,go1.22-linux-386-clang15 Reviewed-on: https://go-review.googlesource.com/c/go/+/589296 Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/591375
2024-06-24[release-branch.go1.22] cmd/cgo/internal/testsanitizers: make the libfuzzer ↵Michael Anthony Knyszek
tests all short CL 589295 only made one of the two tests short, because the other one seemed to be passing consistently in short mode. On the builders, it seems to still fail maybe 30% of the time by taking too long. Disable these tests in short mode. This CL was merged with CL 589295 before cherry-picking. For #67698. Fixes #67715. Change-Id: I9fd047f834f7493b608dd1fee5b9b6dfabbea03d Cq-Include-Trybots: luci.golang.try:go1.22-linux-amd64-clang15,go1.22-linux-386-clang15 Reviewed-on: https://go-review.googlesource.com/c/go/+/589495 Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Michael Knyszek <mknyszek@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/591376
2024-06-24[release-branch.go1.22] cmd/link: put runtime.end in the last section of ↵Cherry Mui
data segment Currently the runtime.end symbol is put into the noptrbss section, which is usually the last section, except that when fuzzing is enabled, the last section is actually .go.fuzzcntrs. The runtime.end symbol has the value pointing to the end of the data segment, so if it is not in the last section, the value will not actually be in the range of the section. This causes an assertion failure in the new Apple linker. This CL fixes this by putting it in the last section. Updates #65169. Fixes #67945. Change-Id: I5c991c46a0483a96e5f6e0255a3b444953676026 Reviewed-on: https://go-review.googlesource.com/c/go/+/592095 Reviewed-by: Than McIntosh <thanm@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit b589478af7f4b09cc9c4d5f76fbbf5cad2b2b7bb) Reviewed-on: https://go-review.googlesource.com/c/go/+/592478
2024-06-24[release-branch.go1.22] cmd/go: fix go list -u -m all with too new ↵Sam Thanawalla
retractions dependency Previously, go would not report retractions of dependencies that have a newer version of Go. With this change, we will still display retractions despite a version difference when go list -u -m is used. For: #66403 Fixes: #68052 Change-Id: I6406680235e294269836ae4cbe3d5680ca10eea0 Reviewed-on: https://go-review.googlesource.com/c/go/+/588775 Auto-Submit: Sam Thanawalla <samthanawalla@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit e44fa1c1a9139ad457d8fa84a68afa3f40e7732a) Reviewed-on: https://go-review.googlesource.com/c/go/+/593355
2024-06-12[release-branch.go1.22] net: add GODEBUG=netedns0=0 to disable sending EDNS0 ↵Ian Lance Taylor
header It reportedly breaks the DNS server on some modems. For #6464 For #21160 For #44135 For #51127 For #51153 For #67925 Fixes #67934 Change-Id: I54a11906159f00246d08a54cc8be7327e9ebfd2c Reviewed-on: https://go-review.googlesource.com/c/go/+/591995 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> (cherry picked from commit ee4a42bd583b8594e97f1833c4b4c6e6428d9227) Reviewed-on: https://go-review.googlesource.com/c/go/+/592217 TryBot-Bypass: Ian Lance Taylor <iant@golang.org> Commit-Queue: Ian Lance Taylor <iant@google.com>
2024-06-12[release-branch.go1.22] go/internal/gccgoimporter: recognize "any" as a ↵Ian Lance Taylor
builtin type In CL 536715 we're changing the gofrontend export data to report "any" as a builtin type. This permits us to distinguish the builtin type from some other package-level type "any". That requires an update to this code. Fixes #67850 Change-Id: I91d75a056a155fa9892c4b25ab396cb4d39cc8e4 Reviewed-on: https://go-review.googlesource.com/c/go/+/537195 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> (cherry picked from commit b8ac61e6e64c92f23d8cf868a92a70d13e20a124) Reviewed-on: https://go-review.googlesource.com/c/go/+/592215 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2024-06-04[release-branch.go1.22] go1.22.4go1.22.4Gopher Robot
Change-Id: I7bdd3eccef31bfc66be5f5ebf6d124005f0c2bf7 Reviewed-on: https://go-review.googlesource.com/c/go/+/590418 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2024-06-04[release-branch.go1.22] net/netip: check if address is v6 mapped in Is methodsRoland Shoemaker
In all of the Is* methods, check if the address is a v6 mapped v4 address, and unmap it if so. Thanks to Enze Wang of Alioth (@zer0yu) and Jianjun Chen of Zhongguancun Lab (@chenjj) for reporting this issue. Fixes #67680 Fixes #67682 Fixes CVE-2024-24790 Change-Id: I6bd03ca1a5d93a0b59027d861c84060967b265b0 Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1460 Reviewed-by: Russ Cox <rsc@google.com> Reviewed-by: Damien Neil <dneil@google.com> (cherry picked from commit f7f270c1621fdc7ee48e0487b2fac0356947d19b) Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1480 Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/590296 Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-30[release-branch.go1.22] os: RemoveAll: fix symlink race for unixKir Kolyshkin
Since all the platforms now support O_DIRECTORY flag for open, it can be used to (together with O_NOFOLLOW) to ensure we open a directory, thus eliminating the need to call stat before open. This fixes the symlink race, when a directory is replaced by a symlink in between stat and open calls. While at it, rename openFdAt to openDirAt, because this function is (and was) meant for directories only. NOTE Solaris supports O_DIRECTORY since before Solaris 11 (which is the only version Go supports since supported version now), and Illumos always had it. The only missing piece was O_DIRECTORY flag value, which is taken from golang.org/x/sys/unix. Fixes #67696. Change-Id: Ic1111d688eebc8804a87d39d3261c2a6eb33f176 Reviewed-on: https://go-review.googlesource.com/c/go/+/589056 Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2024-05-29[release-branch.go1.22] runtime: x_cgo_getstackbound: initialize pthread attrKir Kolyshkin
In glibc versions older than 2.32 (before commit 4721f95058), pthread_getattr_np does not always initialize the `attr` argument, and when it fails, it results in a NULL pointer dereference in pthread_attr_destroy down the road. This is the simplest way to avoid this, and an alternative to CL 585019. Fixes #67650. Change-Id: If490fd37020b03eb084ebbdbf9ae0248916426d0 Reviewed-on: https://go-review.googlesource.com/c/go/+/587919 Auto-Submit: Ian Lance Taylor <iant@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/587979 Reviewed-by: Carlos Amedee <carlos@golang.org> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Commit-Queue: Matthew Dempsky <mdempsky@google.com>
2024-05-29[release-branch.go1.22] archive/zip: treat truncated EOCDR comment as an errorDamien Neil
When scanning for an end of central directory record, treat an EOCDR signature with a record containing a truncated comment as an error. Previously, we would skip over the invalid record and look for another one. Other implementations do not do this (they either consider this a hard error, or just ignore the truncated comment). This parser misalignment allowed presenting entirely different archive contents to Go programs and other zip decoders. For #66869 Fixes #67554 Change-Id: I94e5cb028534bb5704588b8af27f1e22ea49c7c6 Reviewed-on: https://go-review.googlesource.com/c/go/+/585397 Reviewed-by: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 33d725e5758bf1fea62e6c77fc70b57a828a49f5) Reviewed-on: https://go-review.googlesource.com/c/go/+/588796 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2024-05-24[release-branch.go1.22] cmd/link: add runtime.text.N symbols to macho symbol ↵Cherry Mui
table in dynlink mode In dynamic linking mode (e.g. when using plugins) on darwin, the marker symbols runtime.text and runtime.etext are added to Textp in an early stage, so when adding symbols to the symbol table we don't need to explicitly add them. However, when splitting text sections, the runtime.text.N marker symbols for the addtional sections are not added to Textp. So we do need to add them explicitly to the symbol table. Updates #66993. Fixes #67527. Change-Id: Ic718d03cd71fc0bfb931cff82640b1f4c53b89be Reviewed-on: https://go-review.googlesource.com/c/go/+/586555 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Than McIntosh <thanm@google.com> (cherry picked from commit 9a9dd72d5c2b2f808a0a7ef204e307bc1dbee78c) Reviewed-on: https://go-review.googlesource.com/c/go/+/586081
2024-05-24[release-branch.go1.22] runtime: update large object stats before freeSpan ↵Michael Anthony Knyszek
in sweep Currently freeSpan is called before large object stats are updated when sweeping large objects. This means heapStats.inHeap might get subtracted before the large object is added to the largeFree field. The end result is that the /memory/classes/heap/unused:bytes metric, which subtracts live objects (alloc-free) from inHeap may overflow. Fix this by always updating the large object stats before calling freeSpan. For #67019. Fixes #67188. Change-Id: Ib02bd8dcd1cf8cd1bc0110b6141e74f678c10445 Reviewed-on: https://go-review.googlesource.com/c/go/+/583380 Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Felix Geisendörfer <felix.geisendoerfer@datadoghq.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Pratt <mpratt@google.com> (cherry picked from commit 36d32f68f41561fb64677297e3733f5d5b866c2a) Reviewed-on: https://go-review.googlesource.com/c/go/+/584339 Reviewed-by: Carlos Amedee <carlos@golang.org>
2024-05-24[release-branch.go1.22] cmd/compile: initialize posBaseMap correctlyRobert Griesemer
The posBaseMap is used to identify a file's syntax tree node given a source position. The position is mapped to the file base which is then used to look up the file node in posBaseMap. When posBaseMap is initialized, the file position base is not the file base if there's a line directive before the package clause. This can happen in cgo-generated files, for instance due to an import "C" declaration. If the wrong file position base is used during initialization, looking up a file given a position will not find the file. If a version error occurs and the corresponding file is not found, the old code panicked with a null pointer exception. Make sure to consistently initialize the posBaseMap by factoring out the code computing the file base from a given position. While at it, check for a nil file pointer. This should not happen anymore, but don't crash if it happens (at the cost of a slightly less informative error message). Fixes #67460. Change-Id: I4a6af88699c32ad01fffce124b06bb7f9e06f43d Reviewed-on: https://go-review.googlesource.com/c/go/+/586238 Reviewed-by: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/586161
2024-05-16[release-branch.go1.22] crypto/x509: remove TestPlatformVerifierLegacy testsRoland Shoemaker
They are no longer necessary, woohoo! Updates #52108 Fixes #56791 Fixes #67352 Change-Id: I11a4c17162da4295309f74f2f8362bab0f506f78 Reviewed-on: https://go-review.googlesource.com/c/go/+/548976 Run-TryBot: Roland Shoemaker <roland@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit c1828fbcbf8b8e18308e87bbac0d71244ec167f5) Reviewed-on: https://go-review.googlesource.com/c/go/+/586235 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2024-05-15[release-branch.go1.22] cmd/compile: avoid past-the-end pointer when zeroingKeith Randall
When we optimize append(s, make([]T, n)...), we have to be careful not to pass &s[0] + len(s)*sizeof(T) as the argument to memclr, as that pointer might be past-the-end. This can only happen if n is zero, so just special-case n==0 in the generated code. Fixes #67258 Change-Id: Ic680711bb8c38440eba5e759363ef65f5945658b Reviewed-on: https://go-review.googlesource.com/c/go/+/584116 Reviewed-by: Austin Clements <austin@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@google.com> (cherry picked from commit 93e3696b5dac778cf638a67616a4a4d521d6fce9) Reviewed-on: https://go-review.googlesource.com/c/go/+/584315 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2024-05-13[release-branch.go1.22] cmd/go/testdata/script: add darwin skips for ↵Than McIntosh
selected buildrepro tests Skip two build reproducibility tests (build_issue48319 and build_plugin_reproducible) on Darwin if GO_BUILDER_NAME is set until issue 64947 can be resolved; on the LUCI darwin longtest builder the more contemporary version of Xcode is doing things that are unfriendly to Go's build reproducibility. For #64947. Fixes #67314 Change-Id: Iebd433ad6dfeb84b6504ae9355231d897d8ae174 Reviewed-on: https://go-review.googlesource.com/c/go/+/565376 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 53708d86b076b7295e93e49b7a19ac7d9082044f) Reviewed-on: https://go-review.googlesource.com/c/go/+/584238 Reviewed-by: Than McIntosh <thanm@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@google.com> TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
2024-05-13[release-branch.go1.22] cmd/go/testdata/script: clear path in ↵Michael Matloob
gotoolchain_issue66175 The gotoolchain_issue66175 script test would fail if a binary named go1.21 or go1.22 was present in the system PATH. Clear the path at the beginning of the test to make it independent of the system path. For #67277 Fixes #67311 Change-Id: I6d9133aee5b20ab116e07b659e8ecf3eb8add4ed Reviewed-on: https://go-review.googlesource.com/c/go/+/584258 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com> (cherry picked from commit a0a6026bb176d25401d7d188f95c1fe769d71db8) Reviewed-on: https://go-review.googlesource.com/c/go/+/584955 Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
2024-05-10[release-branch.go1.22] cmd/compile: don't combine loads in generated ↵khr@golang.org
equality functions ... if the architecture can't do unaligned loads. We already handle this in a few places, but this particular place was added in CL 399542 and missed this additional restriction. Fixes #67212 (Reroll of CL 583417) Change-Id: I8ee74909341e0af0d51d3761e17ff92e744ecd38 Reviewed-on: https://go-review.googlesource.com/c/go/+/583798 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-10[release-branch.go1.22] cmd/go: download 1.X.0 instead of 1.X during ↵Sam Thanawalla
toolchain upgrade. This CL modifies the download behavior when downloading a toolchain for 1.21+. Previously, Go would attempt to download 1.X when upgrading the toolchain which would cause the download to fail for 1.21+ since 1.X is an invalid toolchain. We will attempt to download 1.X.0 since that's likely what the user intended. Additionally, we will also now provide a better error message when the user provides a language version instead of a toolchain version for 1.21+. For #66175 For #62278 Fixes #67236 Change-Id: I28f894290a19d8e3cd220e9d70aeca8f4447e5a1 Reviewed-on: https://go-review.googlesource.com/c/go/+/580217 Reviewed-by: Michael Matloob <matloob@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> (cherry picked from commit 27ed85d4d1702e868730ab6ea2ad6326988c615c) Reviewed-on: https://go-review.googlesource.com/c/go/+/583915
2024-05-07[release-branch.go1.22] go1.22.3go1.22.3Gopher Robot
Change-Id: Ie006d71637a9fa66c225f3fd6cb19dae2a403e76 Reviewed-on: https://go-review.googlesource.com/c/go/+/583856 Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
2024-05-07[release-branch.go1.22] cmd/go: disallow -lto_library in LDFLAGSRoland Shoemaker
The darwin linker allows setting the LTO library with the -lto_library flag. This wasn't caught by our "safe linker flags" check because it was covered by the -lx flag used for linking libraries. This change adds a specific check for excluded flags which otherwise satisfy our existing checks. Loading a mallicious LTO library would allow an attacker to cause the linker to execute abritrary code when "go build" was called. Thanks to Juho Forsén of Mattermost for reporting this issue. Fixes #67119 Fixes #67122 Fixes CVE-2024-24787 Change-Id: I77ac8585efbdbdfd5f39c39ed623b9408a0f9eaf Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1380 Reviewed-by: Russ Cox <rsc@google.com> Reviewed-by: Damien Neil <dneil@google.com> (cherry picked from commit 9a79141fbbca1105e5c786f15e38741ca7843290) Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/1420 Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/583796 Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2024-05-06[release-branch.go1.22] Revert "cmd/compile: don't combine loads in ↵Cherry Mui
generated equality functions" This reverts CL 583417. Reason for revert: release branch is currently frozen. Change-Id: Ia6223911e0e124f14509c4bf978d7e37688e3d4c Reviewed-on: https://go-review.googlesource.com/c/go/+/582960 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>