]> Cypherpunks repositories - gostls13.git/log
gostls13.git
9 days ago[release-branch.go1.26] os: avoid escape from Root via ReadDir or Readdir
Damien Neil [Thu, 26 Feb 2026 17:54:33 +0000 (09:54 -0800)]
[release-branch.go1.26] os: avoid escape from Root via ReadDir or Readdir

When reading the contents of a directory using
File.ReadDir or File.Readdir, the os.FileInfo was
populated on Unix platforms using lstat.
This lstat call is vulnerable to a TOCTOU race
and could escape the root.

For example:
  - Open the directory "dir" within a Root.
    This directory contains a file named "file".
  - Use File.ReadDir to list the contents of "dir",
    receiving a os.DirEntry for "dir/file".
  - Replace "dir" with a symlink to "/etc".
  - Use DirEntry.Info to retrieve the FileInfo for "dir/file".
    This FileInfo contains information on "/etc/file" instead.

This escape permits identifying the presence or absence of
files outside a Root, as well as retreiving stat metadata
(size, mode, modification time, etc.) for files outside a Root.

This escape does not permit reading or writing to files
outside a Root.

For #77827
Fixes #77834
Fixes CVE-2026-27139

Change-Id: I40004f830c588e516aff8ee593d630d36a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/749480
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
Auto-Submit: Damien Neil <dneil@google.com>
(cherry picked from commit 657ed934e85dc575aad51356c4b437961e7c1313)
Reviewed-on: https://go-review.googlesource.com/c/go/+/749822

10 days ago[release-branch.go1.26] cmd/compile: ensure StructMake/ArrayMake1 of direct interface...
Keith Randall [Wed, 11 Feb 2026 01:44:08 +0000 (17:44 -0800)]
[release-branch.go1.26] cmd/compile: ensure StructMake/ArrayMake1 of direct interfaces are unwrapped

Ensures that deeply nested structs that have the underlying shape
of a pointer get unwrapped properly.

Update #77536

Change-Id: I004f424d2c62ec7026281daded9b3d96c021e2e1
Reviewed-on: https://go-review.googlesource.com/c/go/+/747760
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
(cherry picked from commit 1aa534dbb8970b86b0f4059b7665e3505d145e25)
Reviewed-on: https://go-review.googlesource.com/c/go/+/749460

11 days ago[release-branch.go1.26] cmd/compile: pointer-shaped types are SSAable even if lots...
Keith Randall [Wed, 11 Feb 2026 01:44:08 +0000 (17:44 -0800)]
[release-branch.go1.26] cmd/compile: pointer-shaped types are SSAable even if lots of 0-sized fields

Normally we don't SSA-ify variables with types that have more than
4 fields. But we really do want to SSA-ify them if they are pointer
shaped.

An odd case, but the compiler shouldn't barf on them.

Failure probably started with CL 714421.

Fixes #77536

Change-Id: I51ef87676cc31df1e51e164bbd58d58c0ab72436
Reviewed-on: https://go-review.googlesource.com/c/go/+/744280
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
(cherry picked from commit 6435bf46c17dccb2eb5f7bab7dd8aa4972252b21)
Reviewed-on: https://go-review.googlesource.com/c/go/+/749421
Reviewed-by: Mark Freeman <markfreeman@google.com>
11 days ago[release-branch.go1.26] net/smtp: prevent test failures due to expired test certificate
Nicholas S. Husin [Tue, 10 Feb 2026 22:17:19 +0000 (17:17 -0500)]
[release-branch.go1.26] net/smtp: prevent test failures due to expired test certificate

The current localhostCert used for testing seems to have its expiry date
mistakenly set to Mar 18 19:27:54 2026 GMT.

To prevent test failures, use fixed time in tests. Also, regenerate the
certificate so we can fix the time to UNIX epoch (the current
certificate is only valid after Mar 18 2025).

Fixes #77532

Change-Id: I3136d29eaa0c8c4361f5627003f08a0059702f0d
Reviewed-on: https://go-review.googlesource.com/c/go/+/744260
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Nicholas Husin <husin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit 215a070a049ce449480ca6948e7fafdeb7b16920)
Reviewed-on: https://go-review.googlesource.com/c/go/+/748061

11 days ago[release-branch.go1.26] cmd/go: fix pkg-config flag sanitization
Roland Shoemaker [Tue, 3 Feb 2026 02:29:51 +0000 (18:29 -0800)]
[release-branch.go1.26] cmd/go: fix pkg-config flag sanitization

Implement a new pkg-config safe flag list (containing everything except
for --log-file) and use that when checking flags passed to pkg-config,
instead of using checkCompilerFlags.

Updates #77387
Fixes #77474

Change-Id: Id6141d0a2934053aa43e3aa8ce402bd499c4c028
Reviewed-on: https://go-review.googlesource.com/c/go/+/741042
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
(cherry picked from commit 28fbdf7acb4146b5bc3d88128e407d1344691839)
Reviewed-on: https://go-review.googlesource.com/c/go/+/745480
Reviewed-by: David Chase <drchase@google.com>
11 days ago[release-branch.go1.26] cmd/compile: avoid folding 64-bit integers into 32-bit constants
Youlin Feng [Sat, 14 Feb 2026 10:55:34 +0000 (18:55 +0800)]
[release-branch.go1.26] cmd/compile: avoid folding 64-bit integers into 32-bit constants

Folding a 64-bit integer into a 32-bit constant may result in a negative
integer if the value exceeds math.MaxInt32 (the maximum value of a 32-
bit signed integer). This negative value will be sign-extended to 64
bits at runtime, leading to unexpected results when used in bitwise
AND/OR operations.

Fixes #77618

Change-Id: Idb081a3c20c28bddddcc8eff1225d62123b37a2d
Reviewed-on: https://go-review.googlesource.com/c/go/+/745581
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
(cherry picked from commit 3c8b5e673816c733f13a38b1ed1f53d7d49ea084)
Reviewed-on: https://go-review.googlesource.com/c/go/+/745840
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
11 days ago[release-branch.go1.26] go/analysis/passes/modernize: add vendored code
Mark Freeman [Tue, 17 Feb 2026 21:11:00 +0000 (16:11 -0500)]
[release-branch.go1.26] go/analysis/passes/modernize: add vendored code

Note this is a sum of CLs 731340, 733180, and 736715.

Fixes #77529
Fixes #77624

Change-Id: I0c8119877184d2e6506d0b34895a746bafed3829
Reviewed-on: https://go-review.googlesource.com/c/go/+/746360
Reviewed-by: Madeline Kalil <mkalil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
12 days ago[release-branch.go1.26] cmd/compile: fix mis-compilation for static array initialization
Cuong Manh Le [Wed, 21 Jan 2026 07:39:20 +0000 (14:39 +0700)]
[release-branch.go1.26] cmd/compile: fix mis-compilation for static array initialization

The bug was first introduced when the compiler is still written in C,
with CL 2254041. The static array was laid out with the wrong context,
causing a stack pointer will be stored in global object.

Fixes #77252

Change-Id: I22c8393314d251beb53db537043a63714c84f36a
Reviewed-on: https://go-review.googlesource.com/c/go/+/737821
Reviewed-by: Dmitri Shuralyov <dmitshur@google.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>
Auto-Submit: Keith Randall <khr@golang.org>
(cherry picked from commit dae71067ce7ee41ebe752a4ee3c544506e74f824)
Reviewed-on: https://go-review.googlesource.com/c/go/+/738940
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
12 days ago[release-branch.go1.26] cmd/compile: don't drop same register twice
khr@golang.org [Sat, 14 Feb 2026 18:04:13 +0000 (10:04 -0800)]
[release-branch.go1.26] cmd/compile: don't drop same register twice

For instructions that clobber both of their input registers, make
sure we don't clobber the same register twice when both input
registers are the same.

This is rare, but it can happen.

Fixes #77623

Change-Id: I794249cf43a8cc4ab3262055daef9193e2442f73
Reviewed-on: https://go-review.googlesource.com/c/go/+/745621
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
(cherry picked from commit f65692ea562bf24c21ae46854e98584dd4bcc201)
Reviewed-on: https://go-review.googlesource.com/c/go/+/745820
Reviewed-by: Mark Freeman <markfreeman@google.com>
12 days ago[release-branch.go1.26] reflect: use &zeroVal[0] instead of nil for data field for...
Keith Randall [Tue, 24 Feb 2026 23:31:08 +0000 (15:31 -0800)]
[release-branch.go1.26] reflect: use &zeroVal[0] instead of nil for data field for zero-sized payloads

Because our wrapper functions barf if the pointer is nil, even if
we don't actually dereference the pointer.

Fixes #77780

Change-Id: Ib1b93d9f0fdc771cd884137007508ba2b1da4b7a
Reviewed-on: https://go-review.googlesource.com/c/go/+/748660
Reviewed-by: Ian Lance Taylor <iant@golang.org>
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: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@google.com>
(cherry picked from commit 60dc96479a85db0e245a5c14d964628169abedf4)
Reviewed-on: https://go-review.googlesource.com/c/go/+/748720
Reviewed-by: David Chase <drchase@google.com>
12 days ago[release-branch.go1.26] cmd/compile: rewriteFixedLoad: ensure AuxInt is sign-extended
Rongrong [Thu, 12 Feb 2026 06:56:43 +0000 (14:56 +0800)]
[release-branch.go1.26] cmd/compile: rewriteFixedLoad: ensure AuxInt is sign-extended

CL 701297 accidentailly broke the type casting behavior for Hash.

Previously, the generated rules for Hash shared a common pattern:

    v.AuxInt = int32ToAuxInt(fixed32(config, sym, off))

which inherently equaled to a signed-extend:

    v.AuxInt = int64(int32(types.TypeHash(...)))

The pattern in CL 701297 was however:

    v.AuxInt = int64(types.TypeHash(t))

Since types.TypeHash() returns a uint32, casting it to a wider integer
implies zero-extend. This diverges from the definition of AuxInt, in
which "Unused portions are filled by sign-extending the used portion,
even if the represented value is unsigned."

As a result, ssa.checkFunc(), where AuxInt is checked against the
mentioned rule, is unhappy and shouts:

    internal compiler error: 'typeAsserts': bad int32 AuxInt value for v1317

Reproduce it with:

    GOARCH=mips go tool compile -m -d=ssa/check/on test/devirtualization.go

This is only reproducible with GOARCH=mips/mipsle (cross and native).
Probably the rewrite rules of other architectures prevent Hash from
running into rewriteFixedLoad.

Fix it by emit sign-extend properly. Additionally, do the same for Kind_
as reflectdata.ABIKindOfType() also returns a fragile unsigned interger
(uint8).

Updates #67304
Fixes #77786

Change-Id: Ib4f3c94c0e3908698868449db2fdcdf4541f2e7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/744860
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Jake Bailey <jacob.b.bailey@gmail.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: 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 a78df5aa0afcd64935f89577c0da0ed2315014ea)
Reviewed-on: https://go-review.googlesource.com/c/go/+/748780
Reviewed-by: David Chase <drchase@google.com>
2 weeks ago[release-branch.go1.26] internal/syscall/windows: correct some enums and syscall...
Michal Pristas [Fri, 13 Feb 2026 18:19:04 +0000 (18:19 +0000)]
[release-branch.go1.26] internal/syscall/windows: correct some enums and syscall signatures

This CL corrects code submitted in CL 741040.

Fixes #77407

Change-Id: I1c22c1a9f77028f3c2a8e3905f2ec5b071b5445e
GitHub-Last-Rev: 2bfb07310b4707484b5bdce96ad367db567741c4
GitHub-Pull-Request: golang/go#77525
Reviewed-on: https://go-review.googlesource.com/c/go/+/743780
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
(cherry picked from commit a09c908cc6e63a89a6206eadb12f8e2800326465)
Reviewed-on: https://go-review.googlesource.com/c/go/+/746720
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>

2 weeks ago[release-branch.go1.26] cmd/link: don't pass -Wl,-S on illumos
Peter Tribble [Wed, 18 Feb 2026 14:24:18 +0000 (14:24 +0000)]
[release-branch.go1.26] cmd/link: don't pass -Wl,-S on illumos

The change in CL 707096 to exclude GOOS=solaris needs to also be applied
for GOOS=illumos, which shares the same linker lineage.

Fixes #77680

Change-Id: Ifc2047595af2db52870f9fb0a9faf646666d9e61
Reviewed-on: https://go-review.googlesource.com/c/go/+/746560
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
(cherry picked from commit 50b63f6cb90a1437ca6756ede016f1918e721da6)
Reviewed-on: https://go-review.googlesource.com/c/go/+/746660
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>

2 weeks ago[release-branch.go1.26] os: support deleting inaccessible files in RemoveAll
Michal Pristas [Wed, 4 Feb 2026 09:36:59 +0000 (09:36 +0000)]
[release-branch.go1.26] os: support deleting inaccessible files in RemoveAll

windows: retry file open with DELETE access after access denied

Additional access rights when opening files, including SYNCHRONIZE,
break deletion when the caller has FILE_DELETE_CHILD on the parent
directory but not the file. Retry with DELETE only restores correct
Windows semantics.

For #77407

Change-Id: Ie53bc6f1673de1a8af4dcfb7496daf99e71098cb
GitHub-Last-Rev: 0ad635cf1a13c0242e3b1922cf47a8c594dd7215
GitHub-Pull-Request: golang/go#77403
Reviewed-on: https://go-review.googlesource.com/c/go/+/741040
Reviewed-by: Quim Muntal <quimmuntal@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
(cherry picked from commit db5882ea9bf63849d554910f486c4c5cfea08852)
Reviewed-on: https://go-review.googlesource.com/c/go/+/746362
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>

3 weeks ago[release-branch.go1.26] go1.26.0 go1.26.0
Gopher Robot [Tue, 10 Feb 2026 19:26:31 +0000 (11:26 -0800)]
[release-branch.go1.26] go1.26.0

Change-Id: Id361013d8afc588e79cdf962a9780e0f03128352
Reviewed-on: https://go-review.googlesource.com/c/go/+/743961
TryBot-Bypass: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
3 weeks ago[release-branch.go1.26] runtime/pprof: fix missing Profile docs
Austin Clements [Tue, 10 Feb 2026 00:17:12 +0000 (19:17 -0500)]
[release-branch.go1.26] runtime/pprof: fix missing Profile docs

CL 688335 accidentally introduced a blank line between the Profile doc
comment and the type definition, causing the entire doc to get dropped.

Change-Id: I97b1c0e57d142d7caea6e543a0138ed6dcd1c3fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/743680
Auto-Submit: Austin Clements <austin@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
4 weeks ago[release-branch.go1.26] simd/archsimd: correct algorithm name in SHA256 ops documentation
Tom Thorogood [Sun, 11 Jan 2026 07:00:06 +0000 (17:30 +1030)]
[release-branch.go1.26] simd/archsimd: correct algorithm name in SHA256 ops documentation

The three SHA256 ops (SHA256Message1, SHA256Message2 and SHA256TwoRounds)
all incorrectly referred to the SHA1 algorithm in their documentation
rather than SHA256.

Change-Id: Id6c1bfe4fee4517c0e498fb063cc9112464bc1e7
Reviewed-on: https://go-review.googlesource.com/c/go/+/735420
Reviewed-by: Junyang Shao <shaojunyang@google.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 0430fa977573866f93e66aa61a66b37ff0738aba)
Reviewed-on: https://go-review.googlesource.com/c/go/+/742583
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

4 weeks ago[release-branch.go1.26] crypto/tls: avoid data race when canceling a QUICConn's Context
Damien Neil [Thu, 5 Feb 2026 23:56:13 +0000 (15:56 -0800)]
[release-branch.go1.26] crypto/tls: avoid data race when canceling a QUICConn's Context

Methods on QUICConn are synchronous:
The connection state is expected to change only in reaction
to a user calling a QUICConn method, and the state change
should finish completely before the method returns.

The connection context provided to QUICConn.Start violates
this model, because canceling the context causes an
asynchronous state change.

Prior to CL 719040, this caused no problems because canceling
the context did not cause any user-visible state changes.
In particular, canceling the context did not cause any new
events to be immediately returned by QUICConn.NextEvent.

CL 719040 introduced a new error event. Now, canceling a
QUICConn's context causes a new connection event to be
generated.

Receiving this event causes a data race visible to the
race detector, but the core problem is not the data race
itself: It's that an asynchronous event (canceling the
connection context) causes an change to the connection
events.

Fix this race by reworking the handling of QUICConn
context cancellation a bit. We no longer react to
cancellation while control of the connection lies
with the user. We only process cancellation as
part of a user call, such as QUICConn.Close
or QUICConn.HandleData.

Fixes #77274

Change-Id: If2e0f73618c4852114e0931b6bd0cb0b6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/742561
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
(cherry picked from commit d4febb45179fa99ee1d5783bcb693ed7ba14115c)
Reviewed-on: https://go-review.googlesource.com/c/go/+/742761
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
4 weeks ago[release-branch.go1.26] log/slog: correct method names in MultiHandler docs
Rhys Hiltner [Tue, 3 Feb 2026 17:23:33 +0000 (09:23 -0800)]
[release-branch.go1.26] log/slog: correct method names in MultiHandler docs

For #77428.
Fixes #77429.

Change-Id: I02d76ac9220fb2e0df404e4a446953bc0b56475f
Reviewed-on: https://go-review.googlesource.com/c/go/+/741560
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
(cherry picked from commit ae842f71461ad178eff7283bc36e150fe284b9aa)
Reviewed-on: https://go-review.googlesource.com/c/go/+/742581
Reviewed-by: Rhys Hiltner <rhys.hiltner@gmail.com>
4 weeks ago[release-branch.go1.26] go1.26rc3 go1.26rc3
Gopher Robot [Wed, 4 Feb 2026 15:42:30 +0000 (07:42 -0800)]
[release-branch.go1.26] go1.26rc3

Change-Id: Icdbfe2e74b099da6f3498549873c18e1ef295c64
Reviewed-on: https://go-review.googlesource.com/c/go/+/741942
Auto-Submit: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Bypass: Gopher Robot <gobot@golang.org>

4 weeks ago[release-branch.go1.26] crypto/tls: document resumption behavior across Configs
Filippo Valsorda [Thu, 29 Jan 2026 10:32:25 +0000 (11:32 +0100)]
[release-branch.go1.26] crypto/tls: document resumption behavior across Configs

Updates #77113
Updates #77217
Updates CVE-2025-68121

Change-Id: Ia47904a9ed001275aad0243a6a0ce57e6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/740240
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
(cherry picked from commit 1c9abbdc8e9032cd613bd147c78b166ebacc8a2e)
Reviewed-on: https://go-review.googlesource.com/c/go/+/741181
Auto-Submit: Michael Pratt <mpratt@google.com>

4 weeks ago[release-branch.go1.26] crypto/tls: revalidate whole chain on resumption on Windows...
Filippo Valsorda [Fri, 30 Jan 2026 17:07:23 +0000 (18:07 +0100)]
[release-branch.go1.26] crypto/tls: revalidate whole chain on resumption on Windows and macOS

TestHandshakeChangeRootCAsResumption and TestHandshakeGetConfigForClientDifferentClientCAs
changed because previously rootA and rootB shared Subject and SPKI,
which made the new full-chain revalidation check succeed, as the
same leaf would verify against both roots.

Updates #77376
Fixes #77426

Cq-Include-Trybots: luci.golang.try:go1.26-darwin-arm64-longtest
Change-Id: I60bed694bdc621c9e83f1bd8a8224c016a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/741361
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Roland Shoemaker <roland@golang.org>
(cherry picked from commit b691a2edc7f5863f61a07c4a4f087eef1a15a704)
Reviewed-on: https://go-review.googlesource.com/c/go/+/741680
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

4 weeks ago[release-branch.go1.26] internal/poll: readWriteUnlock should destroy fd when no...
qmuntal [Mon, 2 Feb 2026 11:06:22 +0000 (12:06 +0100)]
[release-branch.go1.26] internal/poll: readWriteUnlock should destroy fd when no remaining references

Updates #77404
Fixes #77405

Change-Id: I0402becb94855baf942d6ba3815cc2a3c1526d6e
Reviewed-on: https://go-review.googlesource.com/c/go/+/740921
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
(cherry picked from commit 31c9bcb1037a332fd547808693cd1899090b5854)
Reviewed-on: https://go-review.googlesource.com/c/go/+/741360
Auto-Submit: Michael Pratt <mpratt@google.com>

5 weeks ago[release-branch.go1.26] cmd/compile/internal/bloop: avoid extraneous heap allocs...
thepudds [Fri, 23 Jan 2026 20:59:40 +0000 (15:59 -0500)]
[release-branch.go1.26] cmd/compile/internal/bloop: avoid extraneous heap allocs in b.Loop body due to autotmp variable scope

The motivating example I created for #73137 still seems
to heap allocate in go1.26rc2 when used in a b.Loop body.

                    │   go1.25    │            go1.26rc2               │
                    │  allocs/op  │ allocs/op   vs base                │
NewX/b.Loop-basic-4   1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=10) ¹

I suspect it is because the temps are by default declared
outside the loop body, which escape analysis will determine is
an escaping value and result in a heap allocation. (I've seen
this problem before, including in my older CL 546023 that attempts
to help PGO with a similar issue.)

This is an attempt to address that by placing ODCLs within the
b.Loop body for the temps that are created so that they can be
marked keepalive.

There are two cases handled in the CL: function return values
and function arguments. The first case is what affects my example
from #73137, and is also illustrated via the NewX test case in
the new test/escape_bloop.go file.

Without this CL, the NewX call in the BenchmarkBloop test is inlined,
which is an improvement over Go 1.25, but the slice still escapes
because the temporary used for the return value is declared outside
the loop body.

With this CL, the slice does not escape.

The second case is illustrated via the new BenchmarkBLoopFunctionArg
test, which shows a function argument that escapes without this CL
but does not escape with this CL.

We can also make the two new b.Loop tests in testing/benchmark_test.go
individually pass or fail as expected based on individually
reverting the two changes in this CL.

While we are here, we add a note to typecheck.TempAt to help
make people aware of this behavior.

Updates #73137
Fixes #77339

Reviewed-on: https://go-review.googlesource.com/c/go/+/738822
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Change-Id: I80e89ca95ba297b0d95f02782e6f4ae901a4361a
Reviewed-on: https://go-review.googlesource.com/c/go/+/740600
Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
5 weeks ago[release-branch.go1.26] simd/archsimd: add missing cpufeature to generated mask/merge...
David Chase [Wed, 28 Jan 2026 20:13:38 +0000 (22:13 +0200)]
[release-branch.go1.26] simd/archsimd: add missing cpufeature to generated mask/merge methods

Change-Id: I34678f4ef17fe1b8b7657a2c3d39685b4a5951f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/739981
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
(cherry picked from commit 985b0b3fe26661c10a3201470e80685765656363)
Reviewed-on: https://go-review.googlesource.com/c/go/+/739941
Reviewed-by: David Chase <drchase@google.com>
5 weeks ago[release-branch.go1.26] crypto/tls: check verifiedChains roots when resuming sessions
Roland Shoemaker [Mon, 26 Jan 2026 19:18:45 +0000 (11:18 -0800)]
[release-branch.go1.26] crypto/tls: check verifiedChains roots when resuming sessions

When resuming TLS sessions, on the server and client verify that the
chains stored in the session state (verifiedChains) are still acceptable
with regards to the Config by checking for the inclusion of the root in
either ClientCAs (server) or RootCAs (client). This prevents resuming
a session with a certificate chain that would be rejected during a full
handshake due to an untrusted root.

Updates #77113
Updates #77357
Updates CVE-2025-68121

Change-Id: I11fe00909ef1961c24ecf80bf5b97f7b1121d359
Reviewed-on: https://go-review.googlesource.com/c/go/+/737700
Auto-Submit: Roland Shoemaker <roland@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Coia Prant <coiaprant@gmail.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-on: https://go-review.googlesource.com/c/go/+/740004
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
5 weeks ago[release-branch.go1.26] crypto/tls: add verifiedChains expiration checking during...
Roland Shoemaker [Mon, 26 Jan 2026 18:55:32 +0000 (10:55 -0800)]
[release-branch.go1.26] crypto/tls: add verifiedChains expiration checking during resumption

When resuming a session, check that the verifiedChains contain at least
one chain that is still valid at the time of resumption. If not, trigger
a new handshake.

Updates #77113
Updates #77357
Updates CVE-2025-68121

Change-Id: I14f585c43da17802513cbdd5b10c552d7a38b34e
Reviewed-on: https://go-review.googlesource.com/c/go/+/739321
Reviewed-by: Coia Prant <coiaprant@gmail.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/740003
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
5 weeks ago[release-branch.go1.26] Revert "crypto/tls: don't copy auto-rotated session ticket...
Roland Shoemaker [Mon, 26 Jan 2026 18:49:30 +0000 (10:49 -0800)]
[release-branch.go1.26] Revert "crypto/tls: don't copy auto-rotated session ticket keys in Config.Clone"

This reverts CL 736709 (commit bba24719a4cad5cc8d771fc9cfff5a38019d554a).

Updates #77113
Updates #77357
Updates CVE-2025-68121

Change-Id: I0261cb75e9adf9d0ac9890dc91ae8476b8988ba0
Reviewed-on: https://go-review.googlesource.com/c/go/+/739320
Reviewed-by: Coia Prant <coiaprant@gmail.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/740002
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Nicholas Husin <nsh@golang.org>
5 weeks ago[release-branch.go1.26] cmd/compile, simd: capture VAES instructions and fix AVX512VA...
Junyang Shao [Thu, 22 Jan 2026 17:44:32 +0000 (17:44 +0000)]
[release-branch.go1.26] cmd/compile, simd: capture VAES instructions and fix AVX512VAES feature

The code previously filters out VAES-only instructions, this CL added
them back.

This CL added the VAES feature check following the Intel xed data:

  XED_ISA_SET_VAES:              vaes.7.0.ecx.9 # avx.1.0.ecx.28

This CL also found out that the old AVX512VAES feature check is not
checking the correct bits, it also fixes it:

  XED_ISA_SET_AVX512_VAES_128:    vaes.7.0.ecx.9  aes.1.0.ecx.25  avx512f.7.0.ebx.16 avx512vl.7.0.ebx.31
  XED_ISA_SET_AVX512_VAES_256:    vaes.7.0.ecx.9  aes.1.0.ecx.25  avx512f.7.0.ebx.16 avx512vl.7.0.ebx.31
  XED_ISA_SET_AVX512_VAES_512:    vaes.7.0.ecx.9  aes.1.0.ecx.25  avx512f.7.0.ebx.16

It restricts to the most strict common set - includes avx512vl for even
512-bits although it doesn't requires it.

Change-Id: I4e2f72b312fd2411589fbc12f9ee5c63c09c2e9a
Reviewed-on: https://go-review.googlesource.com/c/go/+/738500
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
(cherry picked from commit 83b232b0af1bd498d3df099eb68e3b1e40df2527)
Reviewed-on: https://go-review.googlesource.com/c/go/+/739922
Reviewed-by: Junyang Shao <shaojunyang@google.com>
6 weeks ago[release-branch.go1.26] internal/buildcfg: disable sizespecializedmalloc by default
Michael Anthony Knyszek [Fri, 23 Jan 2026 16:38:50 +0000 (16:38 +0000)]
[release-branch.go1.26] internal/buildcfg: disable sizespecializedmalloc by default

We're finding some regressions in overall icache footprint at scale and
we should figure out how to deal with those before rolling this out to
everybody.

Change-Id: I98e792db31712bf64575d76dfeafedb48898f76a
Reviewed-on: https://go-review.googlesource.com/c/go/+/738780
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
(cherry picked from commit 4af8ad24ee3b55ccb644680d95e2502e5551ea0b)
Reviewed-on: https://go-review.googlesource.com/c/go/+/738900

6 weeks ago[release-branch.go1.26] all: merge master (2baa1d1) into release-branch.go1.26
Carlos Amedee [Wed, 21 Jan 2026 20:45:40 +0000 (15:45 -0500)]
[release-branch.go1.26] all: merge master (2baa1d1) into release-branch.go1.26

For #76474.

Change-Id: Ic50e288f99b731b62af9aa73ce6721f0f2f3596d

6 weeks agoruntime: remove the unused scanIdx from mspan
Youlin Feng [Sat, 17 Jan 2026 06:20:22 +0000 (14:20 +0800)]
runtime: remove the unused scanIdx from mspan

After CL 700496, mspan.scanIdx is never used, this CL just remove it.

Change-Id: I41ce9902957c0cfa6fbf26b66a2a7787b179376a
Reviewed-on: https://go-review.googlesource.com/c/go/+/737220
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Auto-Submit: Carlos Amedee <carlos@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
6 weeks agocmd/compile/internal/staticinit: fix bug in global new(expr)
Alan Donovan [Tue, 20 Jan 2026 21:18:59 +0000 (16:18 -0500)]
cmd/compile/internal/staticinit: fix bug in global new(expr)

The StaticInit pass asserts that the operand of &v is a global,
but this is not so for the &autotemp desugaring of new(expr).

(The variable has by that point escaped to the heap, so
the object code calls runtime.newobject. A future optimization
would be to statically allocate the variable when it is safe
and advantageous to do so.)

Thanks to khr for suggesting the fix.

+ static test

Fixes #77237

Change-Id: I71b34a1353fe0f3e297beab9851f8f87d765d8f1
Reviewed-on: https://go-review.googlesource.com/c/go/+/737680
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>

6 weeks agostrconv: don't call internal Atoi twice in Atoi
Daniel Müllner [Mon, 19 Jan 2026 08:18:05 +0000 (09:18 +0100)]
strconv: don't call internal Atoi twice in Atoi

Change-Id: I89a41bbc83fdf473399527a933d57794ce83f68a
Reviewed-on: https://go-review.googlesource.com/c/go/+/737261
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
7 weeks agodoc: fix urlmaxqueryparams typos
Michael Pratt [Fri, 16 Jan 2026 17:20:39 +0000 (12:20 -0500)]
doc: fix urlmaxqueryparams typos

Updates #77101.

Change-Id: I6a6a636cd58e1bd01943066368cb1424db6c6a92
Reviewed-on: https://go-review.googlesource.com/c/go/+/737040
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agogo/types,cmd/compile/internal/types2: better diagnostic for type shadowing
Alan Donovan [Thu, 18 Dec 2025 17:27:11 +0000 (12:27 -0500)]
go/types,cmd/compile/internal/types2: better diagnostic for type shadowing

This change causes the "x is not a type" diagnostic to describe
x's actual kind, helping to reveal when shadowing is at work.

(The kind description could improve other errors too.)

Fixes #76877

Change-Id: Ia3484998bb384ff570c20b6792cf8461c60aa38c
Reviewed-on: https://go-review.googlesource.com/c/go/+/731180
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>

7 weeks agoarchive/zip: reduce CPU usage in index construction
Damien Neil [Wed, 5 Nov 2025 01:00:33 +0000 (17:00 -0800)]
archive/zip: reduce CPU usage in index construction

Constructing the zip index (which is done once when first opening
a file in an archive) can consume large amounts of CPU when
processing deeply-nested directory paths.

Switch to a less inefficient algorithm.

Thanks to Jakub Ciolek for reporting this issue.

goos: darwin
goarch: arm64
pkg: archive/zip
cpu: Apple M4 Pro
                          │  /tmp/bench.0  │            /tmp/bench.1            │
                          │     sec/op     │   sec/op     vs base               │
ReaderOneDeepDir-14         25983.62m ± 2%   46.01m ± 2%  -99.82% (p=0.000 n=8)
ReaderManyDeepDirs-14          16.221 ± 1%    2.763 ± 6%  -82.96% (p=0.000 n=8)
ReaderManyShallowFiles-14      130.3m ± 1%   128.8m ± 2%   -1.20% (p=0.003 n=8)
geomean                         3.801        253.9m       -93.32%

Fixes #77102
Fixes CVE-2025-61728

Change-Id: I2c9c864be01b2a2769eb67fbab1b250aeb8f6c42
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3060
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736713
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
7 weeks agonet/url: add urlmaxqueryparams GODEBUG to limit the number of query parameters
Damien Neil [Mon, 3 Nov 2025 22:28:47 +0000 (14:28 -0800)]
net/url: add urlmaxqueryparams GODEBUG to limit the number of query parameters

net/url does not currently limit the number of query parameters parsed by
url.ParseQuery or URL.Query.

When parsing a application/x-www-form-urlencoded form,
net/http.Request.ParseForm will parse up to 10 MB of query parameters.
An input consisting of a large number of small, unique parameters can
cause excessive memory consumption.

We now limit the number of query parameters parsed to 10000 by default.
The limit can be adjusted by setting GODEBUG=urlmaxqueryparams=<n>.
Setting urlmaxqueryparams to 0 disables the limit.

Thanks to jub0bs for reporting this issue.

Fixes #77101
Fixes CVE-2025-61726

Change-Id: Iee3374c7ee2d8586dbf158536d3ade424203ff66
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3020
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736712
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agocmd/go/internal/work: sanitize flags before invoking 'pkg-config'
Neal Patel [Thu, 4 Dec 2025 17:30:39 +0000 (12:30 -0500)]
cmd/go/internal/work: sanitize flags before invoking 'pkg-config'

The addition of CgoPkgConfig allowed execution with flags not
matching the safelist. In order to prevent potential arbitrary
code execution at build time, ensure that flags are validated
prior to invoking the 'pkg-config' binary.

Thank you to RyotaK (https://ryotak.net) of GMO Flatt Security Inc.
for reporting this issue.

Fixes CVE-2025-61731
Fixes #77100

Change-Id: Ic51b41f1f7e697ab98c9c32c6fae35f217f7f364
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3240
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736711
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agocmd/go: update VCS commands to use safer flag/argument syntax
Roland Shoemaker [Wed, 10 Dec 2025 13:13:07 +0000 (08:13 -0500)]
cmd/go: update VCS commands to use safer flag/argument syntax

In various situations, the toolchain invokes VCS commands. Some of these
commands take arbitrary input, either provided by users or fetched from
external sources. To prevent potential command injection vulnerabilities
or misinterpretation of arguments as flags, this change updates the VCS
commands to use various techniques to separate flags from positional
arguments, and to directly associate flags with their values.

Additionally, we update the environment variable for Mercurial to use
`HGPLAIN=+strictflags`, which is the more explicit way to disable user
configurations (intended or otherwise) that might interfere with command
execution.

We also now disallow version strings from being prefixed with '-' or
'/', as doing so opens us up to making the same mistake again in the
future. As far as we know there are currently ~0 public modules affected
by this.

While I was working on cmd/go/internal/vcs, I also noticed that a
significant portion of the commands being implemented were dead code.
In order to reduce the maintenance burden and surface area for potential
issues, I removed the dead code for unused commands.

We should probably follow up with a more structured change to make it
harder to accidentally re-introduce these issues in the future, but for
now this addresses the issue at hand.

Thanks to splitline (@splitline) from DEVCORE Research Team for
reporting this issue.

Fixes CVE-2025-68119
Fixes #77099

Change-Id: I9d9f4ee05b95be49fe14edf71a1b8e6c0784378e
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3260
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736710
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agocrypto/tls: don't copy auto-rotated session ticket keys in Config.Clone
Roland Shoemaker [Tue, 6 Jan 2026 22:36:01 +0000 (14:36 -0800)]
crypto/tls: don't copy auto-rotated session ticket keys in Config.Clone

Once a tls.Config is used, it is not safe to mutate. We provide the
Clone method in order to allow users to copy and modify a Config that
is in use.

If Config.SessionTicketKey is not populated, and if
Config.SetSessionTicketKeys has not been called, we automatically
populate and rotate session ticket keys. Clone was previously copying
these keys into the new Config, meaning that two Configs could share
the same auto-rotated session ticket keys. This could allow sessions to
be resumed across different Configs, which may have completely different
configurations.

This change updates Clone to not copy the auto-rotated session ticket
keys.

Additionally, when resuming a session, check that not just that the leaf
certificate is unexpired, but that the entire certificate chain is still
unexpired.

Fixes #77113
Fixes CVE-2025-68121

Change-Id: I011df7329de83068d11b3f0c793763692d018a98
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3300
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736709
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks ago[release-branch.go1.26] go1.26rc2 go1.26rc2
Gopher Robot [Thu, 15 Jan 2026 18:25:30 +0000 (10:25 -0800)]
[release-branch.go1.26] go1.26rc2

Change-Id: If5ce85a68010848f16c4c2509e18466ed1356912
Reviewed-on: https://go-review.googlesource.com/c/go/+/736763
TryBot-Bypass: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Gopher Robot <gobot@golang.org>

7 weeks ago[release-branch.go1.26] archive/zip: reduce CPU usage in index construction
Damien Neil [Wed, 5 Nov 2025 01:00:33 +0000 (17:00 -0800)]
[release-branch.go1.26] archive/zip: reduce CPU usage in index construction

Constructing the zip index (which is done once when first opening
a file in an archive) can consume large amounts of CPU when
processing deeply-nested directory paths.

Switch to a less inefficient algorithm.

Thanks to Jakub Ciolek for reporting this issue.

goos: darwin
goarch: arm64
pkg: archive/zip
cpu: Apple M4 Pro
                          │  /tmp/bench.0  │            /tmp/bench.1            │
                          │     sec/op     │   sec/op     vs base               │
ReaderOneDeepDir-14         25983.62m ± 2%   46.01m ± 2%  -99.82% (p=0.000 n=8)
ReaderManyDeepDirs-14          16.221 ± 1%    2.763 ± 6%  -82.96% (p=0.000 n=8)
ReaderManyShallowFiles-14      130.3m ± 1%   128.8m ± 2%   -1.20% (p=0.003 n=8)
geomean                         3.801        253.9m       -93.32%

Fixes #77102
Fixes CVE-2025-61728

Change-Id: I2c9c864be01b2a2769eb67fbab1b250aeb8f6c42
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3060
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3346
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736708
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Bypass: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
7 weeks ago[release-branch.go1.26] net/url: add urlmaxqueryparams GODEBUG to limit the number...
Damien Neil [Mon, 3 Nov 2025 22:28:47 +0000 (14:28 -0800)]
[release-branch.go1.26] net/url: add urlmaxqueryparams GODEBUG to limit the number of query parameters

net/url does not currently limit the number of query parameters parsed by
url.ParseQuery or URL.Query.

When parsing a application/x-www-form-urlencoded form,
net/http.Request.ParseForm will parse up to 10 MB of query parameters.
An input consisting of a large number of small, unique parameters can
cause excessive memory consumption.

We now limit the number of query parameters parsed to 10000 by default.
The limit can be adjusted by setting GODEBUG=urlmaxqueryparams=<n>.
Setting urlmaxqueryparams to 0 disables the limit.

Thanks to jub0bs for reporting this issue.

Fixes #77101
Fixes CVE-2025-61726

Change-Id: Iee3374c7ee2d8586dbf158536d3ade424203ff66
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3020
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3345
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736707
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Bypass: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
7 weeks ago[release-branch.go1.26] cmd/go/internal/work: sanitize flags before invoking 'pkg...
Neal Patel [Thu, 4 Dec 2025 17:30:39 +0000 (12:30 -0500)]
[release-branch.go1.26] cmd/go/internal/work: sanitize flags before invoking 'pkg-config'

The addition of CgoPkgConfig allowed execution with flags not
matching the safelist. In order to prevent potential arbitrary
code execution at build time, ensure that flags are validated
prior to invoking the 'pkg-config' binary.

Thank you to RyotaK (https://ryotak.net) of GMO Flatt Security Inc.
for reporting this issue.

Fixes CVE-2025-61731
Fixes #77100

Change-Id: Ic51b41f1f7e697ab98c9c32c6fae35f217f7f364
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3240
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3324
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736706
Auto-Submit: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
TryBot-Bypass: Michael Pratt <mpratt@google.com>

7 weeks ago[release-branch.go1.26] cmd/go: update VCS commands to use safer flag/argument syntax
Roland Shoemaker [Wed, 10 Dec 2025 13:13:07 +0000 (08:13 -0500)]
[release-branch.go1.26] cmd/go: update VCS commands to use safer flag/argument syntax

In various situations, the toolchain invokes VCS commands. Some of these
commands take arbitrary input, either provided by users or fetched from
external sources. To prevent potential command injection vulnerabilities
or misinterpretation of arguments as flags, this change updates the VCS
commands to use various techniques to separate flags from positional
arguments, and to directly associate flags with their values.

Additionally, we update the environment variable for Mercurial to use
`HGPLAIN=+strictflags`, which is the more explicit way to disable user
configurations (intended or otherwise) that might interfere with command
execution.

We also now disallow version strings from being prefixed with '-' or
'/', as doing so opens us up to making the same mistake again in the
future. As far as we know there are currently ~0 public modules affected
by this.

While I was working on cmd/go/internal/vcs, I also noticed that a
significant portion of the commands being implemented were dead code.
In order to reduce the maintenance burden and surface area for potential
issues, I removed the dead code for unused commands.

We should probably follow up with a more structured change to make it
harder to accidentally re-introduce these issues in the future, but for
now this addresses the issue at hand.

Thanks to splitline (@splitline) from DEVCORE Research Team for
reporting this issue.

Fixes CVE-2025-68119
Fixes #77099

Change-Id: I9d9f4ee05b95be49fe14edf71a1b8e6c0784378e
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3260
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3341
Reviewed-by: Neal Patel <nealpatel@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736705
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Bypass: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
7 weeks ago[release-branch.go1.26] crypto/tls: don't copy auto-rotated session ticket keys in...
Roland Shoemaker [Tue, 6 Jan 2026 22:36:01 +0000 (14:36 -0800)]
[release-branch.go1.26] crypto/tls: don't copy auto-rotated session ticket keys in Config.Clone

Once a tls.Config is used, it is not safe to mutate. We provide the
Clone method in order to allow users to copy and modify a Config that
is in use.

If Config.SessionTicketKey is not populated, and if
Config.SetSessionTicketKeys has not been called, we automatically
populate and rotate session ticket keys. Clone was previously copying
these keys into the new Config, meaning that two Configs could share
the same auto-rotated session ticket keys. This could allow sessions to
be resumed across different Configs, which may have completely different
configurations.

This change updates Clone to not copy the auto-rotated session ticket
keys.

Additionally, when resuming a session, check that not just that the leaf
certificate is unexpired, but that the entire certificate chain is still
unexpired.

Fixes #77113
Fixes CVE-2025-68121

Change-Id: I011df7329de83068d11b3f0c793763692d018a98
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3300
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Nicholas Husin <husin@google.com>
Reviewed-on: https://go-internal-review.googlesource.com/c/go/+/3340
Reviewed-by: Roland Shoemaker <bracewell@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736704
TryBot-Bypass: Michael Pratt <mpratt@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>

7 weeks agosort: improve comment readability for Stable function
Prateik Lohani [Thu, 15 Jan 2026 08:05:23 +0000 (08:05 +0000)]
sort: improve comment readability for Stable function

Change-Id: I3bc9f906f85e2b5f3d4ba6484e3c125065e36b57
GitHub-Last-Rev: 5d637c132533691d5a56fd00845bdb1d349642a3
GitHub-Pull-Request: golang/go#77190
Reviewed-on: https://go-review.googlesource.com/c/go/+/736501
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Keith Randall <khr@golang.org>
Auto-Submit: 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-by: Keith Randall <khr@golang.org>
7 weeks agocrypto/internal/fips140test: add ML-DSA to FIPS 140-3 functional tests
Filippo Valsorda [Fri, 19 Dec 2025 22:14:05 +0000 (23:14 +0100)]
crypto/internal/fips140test: add ML-DSA to FIPS 140-3 functional tests

Change-Id: I568d28d27d2bc55bbadcc678a2fcf9d36a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/731540
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agosimd/archsimd: 128- and 256-bit FMA operations do not require AVX-512
Austin Clements [Tue, 13 Jan 2026 19:18:14 +0000 (14:18 -0500)]
simd/archsimd: 128- and 256-bit FMA operations do not require AVX-512

Currently, all FMA operations are marked as requiring AVX512, even on
smaller vector widths. This is happening because the narrower FMA
operations are marked as extension "FMA" in the XED. Since this
extension doesn't start with "AVX", we filter them out very early in
the XED process. However, this is just a quirk of naming: the FMA
feature depends on the AVX feature, so it is part of AVX, even if it
doesn't say so on the tin.

Fix this by accepting the FMA extension and adding FMA to the table of
CPU features. We also tweak internal/cpu slightly do it correctly
enforces that the logical FMA feature depends on both the FMA and AVX
CPUID flags.

This actually *deletes* a lot of generated code because we no longer
need the AVX-512 encoding of these 128- and 256-bit operations.

Change-Id: I744a18d0be888f536ac034fe88b110347622be7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/736160
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736201
Reviewed-by: Austin Clements <austin@google.com>
7 weeks agosimd/archsimd/_gen/simdgen: feature implications
Austin Clements [Tue, 13 Jan 2026 14:34:53 +0000 (09:34 -0500)]
simd/archsimd/_gen/simdgen: feature implications

This simplifies our handling of XED features, adds a table of which
features imply which other features, and adds this information to the
documentation of the CPU features APIs.

As part of this we fix an issue around the "AVXAES" feature. AVXAES is
defined as the combination of the AVX and AES CPUID flags. Several
other features also work like this, but have hand-written logic in
internal/cpu to compute logical feature flags from the underlying
CPUID bits. For these, we expose a single feature check function from
the SIMD API.

AVXAES currently doesn't work like this: it requires the user to check
both features. However, this forces the SIMD API to expose an "AES"
feature check, which really has nothing to do with SIMD. To make this
consistent, we introduce an AVXAES feature check function and use it
in feature requirement docs. Unlike the others combo features, this is
implemented in the simd package, but the difference is invisible to
the user.

Change-Id: I2985ebd361f0ecd45fd428903efe4c981a5ec65d
Reviewed-on: https://go-review.googlesource.com/c/go/+/736100
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-on: https://go-review.googlesource.com/c/go/+/736200
Reviewed-by: Austin Clements <austin@google.com>
7 weeks agoruntime: rename mallocTiny* to mallocgcTinySize*
Michael Matloob [Mon, 12 Jan 2026 19:37:39 +0000 (14:37 -0500)]
runtime: rename mallocTiny* to mallocgcTinySize*

This makes it easier to identify which functions are used for memory
allocation by looking for functions that start with mallocgc. The Size
suffix is added so that the isSpecializedMalloc function in
cmd/compile/internal/ssa can distinguish between the generated functions
and the mallocgcTiny function called by mallocgc, similar to the SC
suffixes for the mallocgcSmallNoScanSC* and mallocgcSmallScanNoHeaderSC*
functons.

Change-Id: I6ad7f15617bf6f18ae5d1bfa2a0b94e86a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/735780
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agoall: fix misspellings in comments
cuishuang [Wed, 7 Jan 2026 05:46:43 +0000 (13:46 +0800)]
all: fix misspellings in comments

Change-Id: I121847e7f68c602dd8e9ecddfc41b547f8a86f10
Reviewed-on: https://go-review.googlesource.com/c/go/+/734361
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
7 weeks agoos/exec: move platform-specific LookPath docs to a common comment
Damien Neil [Tue, 6 Jan 2026 23:57:00 +0000 (15:57 -0800)]
os/exec: move platform-specific LookPath docs to a common comment

We have four different LookPath variations (unix, windows, plan9, wasm),
each with slightly different doc comments. Unify the documentation and
move it to a single, common LookPath.

Change-Id: I56bae57e80887a73ef0f6933258ee0a48dbccdcf
Reviewed-on: https://go-review.googlesource.com/c/go/+/734320
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

7 weeks agoos/exec_test: fix test on Plan 9
Ori Bernstein [Sun, 28 Dec 2025 00:08:26 +0000 (19:08 -0500)]
os/exec_test: fix test on Plan 9

Error strings vary across OSes when trying to execute a file
that does not exist. Since matching them is not the point of
the test, ignore them.

Fixes #76965

Change-Id: I6d220bc2d0289070f3441adb48983c13b2a3e597
Reviewed-on: https://go-review.googlesource.com/c/go/+/732940
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Richard Miller <millerresearch@gmail.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
7 weeks agonet: fix socket duplication error handling on Windows
qmuntal [Thu, 8 Jan 2026 14:50:15 +0000 (15:50 +0100)]
net: fix socket duplication error handling on Windows

Calls to dupSocket may fail, but the error is not properly handled
because the surrounding code incorrectly checks for nil error instead
of non-nil error.

I'm not aware of any code paths that would trigger this error, and
I haven't been able to create a test case that does so, but this
change fixes the error handling to correctly propagate any errors
from dupSocket.

Change-Id: I5ffd3cbe8ed58a83634f3b97c0878a7c73e0505e
Reviewed-on: https://go-review.googlesource.com/c/go/+/734821
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
7 weeks agonet: don't ignore getsockname errors in newFileFD
qmuntal [Thu, 8 Jan 2026 14:44:51 +0000 (15:44 +0100)]
net: don't ignore getsockname errors in newFileFD

newFileFD is called when creating a net FD from an existing socket
handle. That socket might not be bound yet, in which case getsockname
returns a useful error that is currently ignored and replaced with a
potentially misleading EPROTONOSUPPORT error later on.

Updates #73696
Updates #74976
Updates #75282
Updates #75279
Updates #76537
Updates #76582
Updates #77038

Change-Id: I2a8b30ffbb037035669f65a95a923edc8b288145
Reviewed-on: https://go-review.googlesource.com/c/go/+/734820
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
7 weeks agonet: don't ignore errors in TestUnixUnlink
qmuntal [Thu, 8 Jan 2026 09:25:44 +0000 (10:25 +0100)]
net: don't ignore errors in TestUnixUnlink

TestUnixUnlink calls some functions and methods that can fail, but it
ignores the returned errors. This test is flaky on Windows, and those
errors should be checked to help diagnose the problem.

Updates #75282
Updates #76582
Updates #77038

Change-Id: Ia868762a4c0b94a7255d57add63777568caa6cd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/734720
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
8 weeks agocrypto: use testenv.Executable(t) instead of os.Args[0] in tests
Filippo Valsorda [Fri, 9 Jan 2026 18:01:50 +0000 (19:01 +0100)]
crypto: use testenv.Executable(t) instead of os.Args[0] in tests

Change-Id: Ib0ec1f05e51a4295a9369d6e8c6b61976a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/735260
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
8 weeks agospec: slightly re-arrange composite literal section for readability
Robert Griesemer [Wed, 7 Jan 2026 01:43:56 +0000 (17:43 -0800)]
spec: slightly re-arrange composite literal section for readability

- introduce subtitles to make various sub-sections easier to find
- split rules for struct literals into two groups (literals without
  and with keys)
- move section on syntax ambiguity up as it pertains to the syntax
  introduced at the start
- move prose specific to map literals into its own section

No language changes.

Change-Id: If8895b869138693179ca6e4d8b1c6ebdc705eccf
Reviewed-on: https://go-review.googlesource.com/c/go/+/734322
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Griesemer <gri@google.com>
8 weeks agocmd/dist: fix goroot typo in panic message
jjpinto [Mon, 5 Jan 2026 22:59:29 +0000 (22:59 +0000)]
cmd/dist: fix goroot typo in panic message

Change-Id: I636a029eedaab0967b774648670710d1303a1f7c
GitHub-Last-Rev: 519faedc5b8327696efeeb431ef66e9fd29f0db7
GitHub-Pull-Request: golang/go#77081
Reviewed-on: https://go-review.googlesource.com/c/go/+/734080
Reviewed-by: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
8 weeks agopath/filepath: Match: improve doc comment
Alan Donovan [Fri, 9 Jan 2026 16:01:00 +0000 (11:01 -0500)]
path/filepath: Match: improve doc comment

Change-Id: Ic7a6e11ddeb79af67ece345405cdca6cf5199173
Reviewed-on: https://go-review.googlesource.com/c/go/+/735180
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agocrypto/rsa: log key on test failure
Filippo Valsorda [Thu, 8 Jan 2026 01:23:02 +0000 (02:23 +0100)]
crypto/rsa: log key on test failure

For #74326

Change-Id: If1e61db22c9e7192e5dd56cd36141e5b6a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734640
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
8 weeks agocmd/go: only use check cache action's dependencies to build vet config
Michael Matloob [Thu, 8 Jan 2026 17:45:34 +0000 (12:45 -0500)]
cmd/go: only use check cache action's dependencies to build vet config

We manipulate the dependencies of the build action when adding the
non-test variant of the package being tested as a dependency for the
test, so the set of deps of the build package doesn't correctly
represent the dependencies of the package that have been built. Restrict
the set of dependencies we use to populate the vet data to the actual
build dependencies depended on by the check cache action so we don't
check an action that we don't actually depend on (and which may not have
completed yet!)

Fixes #75380

Change-Id: I029080d00b3b10a837abcfb7039e00206a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734961
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agoruntime/trace: fix documentation comment
jjpinto [Mon, 5 Jan 2026 23:08:44 +0000 (23:08 +0000)]
runtime/trace: fix documentation comment

Correct documentation comment for mul function

Change-Id: I8b90f02bf0aaba9bb5813833d1b9dd1ebb7d71f4
GitHub-Last-Rev: e91af64af9bad9cd2574dc3dd7ed88123a288be8
GitHub-Pull-Request: golang/go#77082
Reviewed-on: https://go-review.googlesource.com/c/go/+/734100
Reviewed-by: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
8 weeks ago[release-branch.go1.26] all: merge master (6b2505c) into release-branch.go1.26
Junyang Shao [Thu, 8 Jan 2026 18:14:02 +0000 (18:14 +0000)]
[release-branch.go1.26] all: merge master (6b2505c) into release-branch.go1.26

Merge List:

+ 2026-01-08 6b2505c79c cmd/go: remove user-content from doc strings in cgo ASTs.
+ 2026-01-08 4b89bcb8b7 lib/fips140: freeze v1.26.0 FIPS 140-3 module
+ 2026-01-08 8ac4477d83 simd/archsimd: rename Broadcast methods
+ 2026-01-08 5facb3b24b internal/types: add test for cycles in value context
+ 2026-01-07 28147b5283 cmd/go: guarantee a minimum of min(4,GOMAXPROCS) to compile -c
+ 2026-01-07 874d8b98eb cmd/go/internal/work: decrement concurrentProcesses when action finishes
+ 2026-01-07 d1e7f49e3d internal/trace: fix recorder.Write return value for header-only buffers

Change-Id: I863375a1ac0f641b0b02968acf01a602b7d7f2a1

8 weeks agocmd/go: remove user-content from doc strings in cgo ASTs.
Neal Patel [Tue, 6 Jan 2026 21:09:19 +0000 (16:09 -0500)]
cmd/go: remove user-content from doc strings in cgo ASTs.

Thank you to RyotaK (https://ryotak.net) of GMO Flatt Security Inc. for reporting this issue.

Updates golang/go#76697
Fixes CVE-2025-61732

Change-Id: I1121502f1bf1e91309eb4bd41cc3a09c39366d36
Reviewed-on: https://go-review.googlesource.com/c/go/+/734220
Reviewed-by: Agustin Hernandez <garisol1982@gmail.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

8 weeks agolib/fips140: freeze v1.26.0 FIPS 140-3 module
Filippo Valsorda [Fri, 19 Dec 2025 22:14:36 +0000 (23:14 +0100)]
lib/fips140: freeze v1.26.0 FIPS 140-3 module

Fixes #76770

Change-Id: Ia617f01ea9be0d1759147b6cca0403c56a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/731840
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
8 weeks agosimd/archsimd: rename Broadcast methods
Cherry Mui [Thu, 8 Jan 2026 16:57:28 +0000 (11:57 -0500)]
simd/archsimd: rename Broadcast methods

Currently the Broadcast128/256/512 methods broadcast the lowest
element of the input vector to a vector of the corresponding width.
There are also variations of broadcast operations that broadcast
the whole (128- or 256-bit) vector to a larger vector, which we
don't yet support. Our current naming is unclear which version it
is, though. Rename the current ones to Broadcast1ToN, to be clear
that they broadcast one element. The vector version probably will
be named BoradcastAllToN (not included in this CL).

Change-Id: I47a21e367f948ec0b578d63706a40d20f5a9f46d
Reviewed-on: https://go-review.googlesource.com/c/go/+/734840
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
8 weeks agointernal/types: add test for cycles in value context
Mark Freeman [Wed, 7 Jan 2026 21:40:53 +0000 (16:40 -0500)]
internal/types: add test for cycles in value context

Exposition is also added to outline a difference between syntax which
can / cannot produce values of incomplete types.

For us to enforce non-nilness of type RHS and remove the pending type
mechanism, I suspect we would need to add completeness guards to
the syntax which *can*.

Enforcing non-nilness of type RHS currently breaks the below test
cases, but I suspect that is simply an implementation artifact.
In other words, they just call Underlying at a bad time.

  - T0
  - T3
  - T6 / T7
  - T10
  - T12

If we also remove pendingType, all of these test cases break; again,
we would need guards in the appropriate syntax logic.

Change-Id: Ibe22042232e542de1d38b923dd1d5cc50dce08cb
Reviewed-on: https://go-review.googlesource.com/c/go/+/734600
TryBot-Bypass: Mark Freeman <markfreeman@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Mark Freeman <markfreeman@google.com>

2 months agocmd/go: guarantee a minimum of min(4,GOMAXPROCS) to compile -c
Michael Matloob [Mon, 5 Jan 2026 17:23:14 +0000 (12:23 -0500)]
cmd/go: guarantee a minimum of min(4,GOMAXPROCS) to compile -c

To allow this, we also increase the size of the pool to allow the
minimum number for each action, with an extra 2*GOMAXPROCS number of
tokens to boost -c when there are fewer concurrently running actions.
That means the pool will now have the size 6*GOMAXPROCS instead of the
previous 4*GOMAXPROCS.

The goal is to maintain the boosting behavior added by the pool, while
guarding from starving compiles when there are too few tokens left, so
that the value of -c is always at least min(4,GOMAXPROCS), which is what
it was set to before Go 1.26.

Cq-Include-Trybots: luci.golang.try:gotip-linux-arm64_c4as16-perf_vs_parent,gotip-linux-arm64_c4ah72-perf_vs_parent,gotip-linux-amd64_c3h88-perf_vs_parent,gotip-linux-amd64_c2s16-perf_vs_parent
Change-Id: I113a38584514a6c025d3d1bc727ff8d86a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734040
Commit-Queue: Michael Matloob <matloob@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
2 months agocmd/go/internal/work: decrement concurrentProcesses when action finishes
Michael Matloob [Tue, 6 Jan 2026 22:18:48 +0000 (17:18 -0500)]
cmd/go/internal/work: decrement concurrentProcesses when action finishes

This fixes a bug where we only incremented concurrentProcesses but never
decremented it, causing us to run out of tokens and give all compiles
-c=1 after a point.

Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64_c2s16-perf_vs_parent,gotip-linux-amd64_c3h88-perf_vs_parent,gotip-linux-arm64_c4ah72-perf_vs_parent,gotip-linux-arm64_c4as16-perf_vs_parent
Change-Id: I41f4c1edb77004cbc1772d6d672045946a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/734260
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
TryBot-Bypass: Michael Matloob <matloob@google.com>

2 months agointernal/trace: fix recorder.Write return value for header-only buffers
jjpinto [Tue, 6 Jan 2026 22:47:07 +0000 (22:47 +0000)]
internal/trace: fix recorder.Write return value for header-only buffers

Fix issue #77083

Change-Id: I9189d1e3a6efea8478224164e820f50c818abcd5
GitHub-Last-Rev: bb24cbda95f0b5b10aeae9a5ee8cbe215ba6d4eb
GitHub-Pull-Request: golang/go#77092
Reviewed-on: https://go-review.googlesource.com/c/go/+/734300
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Commit-Queue: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 months ago[release-branch.go1.26] all: merge master (f6ebd91) into release-branch.go1.26
Junyang Shao [Wed, 7 Jan 2026 20:06:48 +0000 (20:06 +0000)]
[release-branch.go1.26] all: merge master (f6ebd91) into release-branch.go1.26

Merge List:

+ 2026-01-07 f6ebd91129 all: update vendored x/tools
+ 2026-01-06 d1d0fc7a97 os/exec: avoid atomic.Bool for Cmd.startCalled
+ 2026-01-05 9b2e3b9a02 simd/archsimd: use V(P)MOVMSK for mask ToBits if possible
+ 2026-01-02 f8ee0f8475 cmd/go/testdata/vcstest/git: use git commands that work on older git versions
+ 2026-01-02 b094749bad test/codegen: codify bit related code generation for arm64
+ 2026-01-02 e84983fa40 cmd/compile: optimize SIMD IsNaN.Or(IsNaN)
+ 2026-01-02 8244b85677 simd/archsimd: add tests for IsNaN
+ 2026-01-02 13440fb518 simd/archsimd: make IsNaN unary
+ 2026-01-02 c3550b3352 simd/archsimd: correct documentation of Mask types
+ 2026-01-02 34ad26341d net/rpc: correct comment for isExportedOrBuiltinType function
+ 2025-12-30 b28808d838 cmd/go/internal/modindex: fix obvious bug using failed type assertion
+ 2025-12-30 d64add4d60 simd/archsimd: adjust documentations slightly
+ 2025-12-30 1843cfbcd6 runtime/secret: make tests more sturdy
+ 2025-12-30 fd45d70799 all: fix some minor grammatical issues in the comments
+ 2025-12-30 df4e08ac65 test/codegen: fix a tab in comparisons.go to ensure pattern works
+ 2025-12-30 cd668d744f cmd/compile: disable inlining for functions using runtime.deferrangefunc
+ 2025-12-29 06eff0f7c3 simd/archsimd: add tests for Saturate-Concat operations
+ 2025-12-29 110aaf7137 simd/archsimd: add tests for Saturate operations
+ 2025-12-29 22e7b94e7f simd/archsimd: add tests for ExtendLo operations
+ 2025-12-29 76dddce293 simd/archsimd: remove redundant suffix of ExtendLo operations
+ 2025-12-29 6ecdd2fc6e simd/archsimd: add more tests for Convert operations
+ 2025-12-29 e0c99fe285 simd/archsimd: add more tests for Truncate operations
+ 2025-12-29 08369369e5 reflect: document Call/CallSlice panic when v is unexported field
+ 2025-12-29 ca8effbde1 internal/coverage/decodemeta: correct wording in unknown version error
+ 2025-12-29 0b06b68e21 encoding/gob: clarify docs about pointers to zero values not being sent
+ 2025-12-29 9cb3edbfe9 regexp: standardize error message format in find_test.go
+ 2025-12-29 b3ed0627ce tests: improve consistency and clarity of test diagnostics
+ 2025-12-29 3dcb48d298 test: follow got/want convention in uintptrescapes test
+ 2025-12-29 f7b7e94b0a test: clarify log message for surrogate UTF-8 check
+ 2025-12-29 e790d59674 simd/archsimd: add tests for Truncate operations
+ 2025-12-27 f4cec7917c cmd: fix unused errors reported by ineffassign
+ 2025-12-27 ca13fe02c4 simd/archsimd: add more tests for Convert operations
+ 2025-12-27 037c047f2c simd/archsimd: add more tests for Extend operations
+ 2025-12-26 7971fcdf53 test/codegen: tidy tests for bits
+ 2025-12-24 0f620776d7 simd/archsimd: fix "go generate" command
+ 2025-12-24 a5fe8c07ae simd/archsimd: guard test helpers with amd64 tag
+ 2025-12-23 a23d1a4ebe bytes: improve consistency in split test messages
+ 2025-12-23 866e461b96 cmd/go: update pkgsite doc command to v0.0.0-20251223195805-1a3bd3c788fe
+ 2025-12-23 08dc8393d7 time: skip test that will fail with GO111MODULE=off
+ 2025-12-23 43ebed88cc runtime: improve a log message in TestCleanupLost
+ 2025-12-23 81283ad339 runtime: fix nGsyscallNoP accounting
+ 2025-12-23 3e0e1667f6 test/codegen: codify bit related code generation for riscv64
+ 2025-12-23 3faf988f21 errors: add a test verifying join does not flatten errors
+ 2025-12-23 2485a0bc2c cmd/asm/internal/asm: run riscv64 end-to-end tests for each profile
+ 2025-12-23 8254d66eab cmd/asm/internal/asm: abort end to end test if assembly failed
+ 2025-12-23 1b3db48db7 Revert "errors: optimize errors.Join for single unwrappable errors"
+ 2025-12-23 b6b8b2fe6e cmd/compile: handle propagating an out-of-range jump table index
+ 2025-12-22 2cd0371a0a debug/pe: avoid panic in File.ImportedSymbols
+ 2025-12-22 91435be153 runtime: revert entry point on freebsd/arm64
+ 2025-12-22 c1efada1d2 simd/archsimd: correct documentation for pairwise operations
+ 2025-12-22 3d77a0b15e os/exec: second call to Cmd.Start is always an error
+ 2025-12-20 7ecb1f36ac simd/archsimd: add HasAVX2() guards to tests that need them
+ 2025-12-19 70c22e0ad7 simd/archsimd: delete DotProductQuadruple methods for now
+ 2025-12-19 42cda7c1df simd/archsimd: add Grouped for 256- and 512-bit SaturateTo(U)Int16Concat, and fix type
+ 2025-12-19 baa0ae3aaa simd/archsimd: correct type and instruction for SaturateToUint8
+ 2025-12-19 d46c58debb go/doc: link to struct fields in the same package
+ 2025-12-19 25ed6c7f9b cmd/go/internal/doc: update pkgsite version
+ 2025-12-19 4411edf972 simd/archsimd: reword documentation for some operations
+ 2025-12-19 7d9418a19c simd/archsimd: reword documentation of comparison operations
+ 2025-12-18 d00e96d3ae internal/cpu: repair VNNI feature check
+ 2025-12-18 cfc024daeb simd/archsimd: reword documentation for conversion ops
+ 2025-12-17 ad91f5d241 simd/archsimd: reword documentation of shfit operations
+ 2025-12-17 b8c4cc63e7 runtime: keep track of secret allocation size
+ 2025-12-17 8564fede89 cmd/go: remove reference to no longer existing -i flag
+ 2025-12-17 eecdb61eeb crypto: rename fips140v2.0 to fips140v1.26
+ 2025-12-17 05e41225f6 simd/archsimd: reword documentation of As methods
+ 2025-12-17 516699848b runtime/secret: warn users about allocations, loosen guarantees
+ 2025-12-16 8c28ab936a cmd/cgo: don't emit C local if it is not used
+ 2025-12-16 65b71c11d4 crypto/internal/fips140only: test fips140=only mode
+ 2025-12-16 ea1aa76554 go/doc: exclude examples with results
+ 2025-12-16 5046bdf8a6 crypto/tls: reject trailing messages after client/server hello
+ 2025-12-16 3f6eabdf09 cmd/compile: use unsigned constant when folding loads for SIMD ops with constants
+ 2025-12-16 a4b5b92055 cmd/dist: preserve existing GOEXPERIMENTs when running tests with additional experiments

Change-Id: I84ad4ceba344761142b98587c07d186cf2d638ff

2 months agoall: update vendored x/tools
Dmitri Shuralyov [Fri, 2 Jan 2026 16:36:00 +0000 (11:36 -0500)]
all: update vendored x/tools

Pull in the following x/tools changes:

- CL 732260: go/analysis/passes/modernize: disable BLoop analyzer
- CL 733340: gopls/internal/analysis/modernize: mapsloop: undefined loop-var

For #74967.
For #77008.

[git-generate]
go install golang.org/x/build/cmd/updatestd@latest
go install golang.org/x/tools/cmd/bundle@latest
updatestd -goroot=$(pwd) -branch=internal-branch.go1.26-vendor

Change-Id: Ic0c10569a4a3a292aec9164e6dd034e55d052904
Reviewed-on: https://go-review.googlesource.com/c/go/+/733780
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 months agoos/exec: avoid atomic.Bool for Cmd.startCalled
Alan Donovan [Tue, 6 Jan 2026 19:48:31 +0000 (14:48 -0500)]
os/exec: avoid atomic.Bool for Cmd.startCalled

An atomic.Bool isn't necessary here since, unless otherwise
specified, the methods of an object are not concurrency-safe
w.r.t. each other. Using an atomic causes the copylocks vet
check to warn about copying of Cmd, which is not wrong, because
one shouldn't be copying opaque complex structs from other
packages, but it is a nuisance in the absence of any safe way
to copy a Cmd.

If and when we add a Clone method to Cmd (see #77075) then
it would be appropriate to revert this change so that we get
the benefit of the static check (though ideally we would make
a more explicit tool-readable declaration of the "do not copy"
attribute than merely happening to use an atomic.Bool).

For #77075

Change-Id: I982d4e86623ca165a3e76bbf648fd44041d5f6bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/734200
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 months agosimd/archsimd: use V(P)MOVMSK for mask ToBits if possible
Cherry Mui [Mon, 5 Jan 2026 17:56:08 +0000 (12:56 -0500)]
simd/archsimd: use V(P)MOVMSK for mask ToBits if possible

VPMOVMSKB, VMOVMSKPS, and VMOVMSKPD moves AVX1/2-style masks to
integer registers, similar to VPMOV[BWDQ]2M (which moves to mask
registers). The former is available on AVX1/2, the latter requires
AVX512. So use the former if it is supported, i.e. for 128- and
256-bit vectors with 8-, 32-, and 64-bit elements (16-bit elements
always require AVX512).

Change-Id: I972195116617ed2faaf95cee5cd6b250e671496c
Reviewed-on: https://go-review.googlesource.com/c/go/+/734060
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
2 months agocmd/go/testdata/vcstest/git: use git commands that work on older git versions
Joel Sing [Fri, 12 Dec 2025 08:03:05 +0000 (19:03 +1100)]
cmd/go/testdata/vcstest/git: use git commands that work on older git versions

On older versions of git (such as 2.25.1), `git branch -M master`
fails after `git init` - use `git checkout -b master` instead, which
works across multiple versions.

Fixes tests on the rather outdated linux/mips* builders.

Change-Id: Id86ec82b37a8d2c3131f449276b13989d097d106
Reviewed-on: https://go-review.googlesource.com/c/go/+/729600
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2 months agotest/codegen: codify bit related code generation for arm64
Joel Sing [Wed, 24 Dec 2025 08:11:52 +0000 (19:11 +1100)]
test/codegen: codify bit related code generation for arm64

Also more consistently include commas after constants to increase
accuracy (i.e. "1," cannot inadvertantly match "10")

Change-Id: I480a73859d2e83354b8e9f94bc73c6563976d0e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/733460
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2 months agocmd/compile: optimize SIMD IsNaN.Or(IsNaN)
Cherry Mui [Fri, 2 Jan 2026 19:02:07 +0000 (14:02 -0500)]
cmd/compile: optimize SIMD IsNaN.Or(IsNaN)

IsNaN's underlying instruction, VCMPPS (or VCMPPD), takes two
inputs, and computes either of them is NaN. Optimize the Or
pattern to generate two-operand form.

This implements the optimization mentioned in CL 733660.

Change-Id: I13943b377ee384864c913eed320763f333a03e41
Reviewed-on: https://go-review.googlesource.com/c/go/+/733680
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 months agosimd/archsimd: add tests for IsNaN
Cherry Mui [Wed, 31 Dec 2025 08:00:16 +0000 (03:00 -0500)]
simd/archsimd: add tests for IsNaN

Change-Id: I374ce84fd21c41a04e2d5964d8aa872545c6a8a7
Reviewed-on: https://go-review.googlesource.com/c/go/+/733661
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2 months agosimd/archsimd: make IsNaN unary
Cherry Mui [Wed, 31 Dec 2025 07:42:30 +0000 (02:42 -0500)]
simd/archsimd: make IsNaN unary

Currently, the IsNan API is defined as x.IsNan(y), which returns
a mask to represent, for each element, either x or y is NaN.
Albeit closer to the machine instruction, this is weird API, as
IsNaN is a unary operation. This CL changes it to unary, x.IsNaN().
It compiles to VCMPPS $3, x, x (or VCMPPD). For the two-operand
version, we can optimize x.IsNaN().Or(y.IsNaN()) to VCMPPS $3, x,
y (not done in this CL).

While here, change the name to IsNaN (uppercase both Ns), which
matches math.IsNaN.

Tests in the next CL.

Change-Id: Ib6e7afc2635e6c3c606db5ea16420ee673a6c6d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/733660
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 months agosimd/archsimd: correct documentation of Mask types
Cherry Mui [Tue, 30 Dec 2025 22:08:25 +0000 (17:08 -0500)]
simd/archsimd: correct documentation of Mask types

The documentation of Mask types currently describe vector types,
not masks. Correct them.

Change-Id: Ib2723310842c6d10cfdd772c7abb8d4c1e63b130
Reviewed-on: https://go-review.googlesource.com/c/go/+/733342
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 months agonet/rpc: correct comment for isExportedOrBuiltinType function
jjpinto [Sat, 27 Dec 2025 15:18:07 +0000 (15:18 +0000)]
net/rpc: correct comment for isExportedOrBuiltinType function

Change to follow the idiomatic Go doc comment style

Change-Id: I727801903c8fc1a66c8a71ab5455f12219b469d5
GitHub-Last-Rev: dd608c9cb93d2f9d0358607fab6b58913b499709
GitHub-Pull-Request: golang/go#77015
Reviewed-on: https://go-review.googlesource.com/c/go/+/732902
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Rob Pike <r@golang.org>
Auto-Submit: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 months agocmd/go/internal/modindex: fix obvious bug using failed type assertion
Michael Matloob [Tue, 30 Dec 2025 20:41:41 +0000 (15:41 -0500)]
cmd/go/internal/modindex: fix obvious bug using failed type assertion

adonovan pointed out this bug in the review of CL 733320 and this seems
to be the cause of all those list_empty_importpath flakes. It makes
sense that something nondeterministic would be tied up with the module
index because the state of the cache could depend on the order tests are
run in.

Also remove the parts of the test that accept the flaky behavior so we
can verify the issue has been resolved.

For #73976

Change-Id: Ib64ce6b8eed1dc8d327b7c5e842c1e716a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/733321
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
2 months agosimd/archsimd: adjust documentations slightly
Cherry Mui [Fri, 19 Dec 2025 22:37:37 +0000 (17:37 -0500)]
simd/archsimd: adjust documentations slightly

- Reword the documentation of Scale to mention parameter names.
- Correct the parameter name in Merge.
- Use proper a/an articles in some documentation.
- Add punctuations.
- Format code blocks for long expressions.

Change-Id: I8a31721503c1b155862255619a835895f3d5123a
Reviewed-on: https://go-review.googlesource.com/c/go/+/731560
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 months agoruntime/secret: make tests more sturdy
Daniel Morsing [Sun, 28 Dec 2025 09:29:47 +0000 (09:29 +0000)]
runtime/secret: make tests more sturdy

Technically, the garbage collector can take an arbitrary long time until
it finds a given value unreachable. Account for this fact in our zeroing
tests.

Updates #76586.

Change-Id: Ieaf3cec99afb9204a32524ea559c5f1a280a59e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/732980
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 months agoall: fix some minor grammatical issues in the comments
cuishuang [Thu, 18 Dec 2025 02:36:50 +0000 (10:36 +0800)]
all: fix some minor grammatical issues in the comments

Change-Id: I0459f05e7f6abd9738813c65d993114e931720d5
Reviewed-on: https://go-review.googlesource.com/c/go/+/731000
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>

2 months agotest/codegen: fix a tab in comparisons.go to ensure pattern works
Alexander Musman [Sat, 6 Dec 2025 13:43:55 +0000 (21:43 +0800)]
test/codegen: fix a tab in comparisons.go to ensure pattern works

Fix a pattern in test/codegen/comparisons.go to use whitespace instead
of a tab. The test needs a whitespace to properly fail if the regalloc
change from CL686655 would be missing (in that case we would have a
spill immediately after call to memequal, which is supposed to be
captured by this pattern).

Change-Id: I5b6fb5e861b9327c7f071660592b8ffa265e0030
Reviewed-on: https://go-review.googlesource.com/c/go/+/727620
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
2 months agocmd/compile: disable inlining for functions using runtime.deferrangefunc
zuojunwei.1024 [Tue, 23 Dec 2025 08:12:04 +0000 (16:12 +0800)]
cmd/compile: disable inlining for functions using runtime.deferrangefunc

The rangefunc rewrite pass implements defer using deferrangefunc and
deferproccat. The loop body is rewritten into a closure, it cannot be
inlined due to defer call. But the outer function may still be inlined
in certain scenarios (e.g., with PGO), leading to the defer executing
at the wrong time.

Fixes #77033

Change-Id: I4649fad5cd1b65891832523522002d9352711123
Reviewed-on: https://go-review.googlesource.com/c/go/+/732140
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 months agosimd/archsimd: add tests for Saturate-Concat operations
Cherry Mui [Mon, 29 Dec 2025 20:42:10 +0000 (15:42 -0500)]
simd/archsimd: add tests for Saturate-Concat operations

Change-Id: I9707b68e1ade9fd7c422cb34329edd648e4df7ab
Reviewed-on: https://go-review.googlesource.com/c/go/+/733160
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 months agosimd/archsimd: add tests for Saturate operations
Cherry Mui [Mon, 29 Dec 2025 19:56:53 +0000 (14:56 -0500)]
simd/archsimd: add tests for Saturate operations

Change-Id: Iea095112310802b29b4ef9ca6e559ea3c5aa83ed
Reviewed-on: https://go-review.googlesource.com/c/go/+/733140
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2 months agosimd/archsimd: add tests for ExtendLo operations
Cherry Mui [Mon, 29 Dec 2025 17:41:57 +0000 (12:41 -0500)]
simd/archsimd: add tests for ExtendLo operations

Change-Id: I77a5f0dc58e068882a177dc32d162821b38f34ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/733101
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

2 months agosimd/archsimd: remove redundant suffix of ExtendLo operations
Cherry Mui [Mon, 29 Dec 2025 16:30:33 +0000 (11:30 -0500)]
simd/archsimd: remove redundant suffix of ExtendLo operations

For methods like ExtendLo2ToInt64x2, the last "x2" is redundant, as
it is already mentioned in "Lo2". Remove it, so it is just
ExtendLo2ToInt64.

Change-Id: I490afd818c40bb7a4ef15c249723895735bd6488
Reviewed-on: https://go-review.googlesource.com/c/go/+/733100
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2 months agosimd/archsimd: add more tests for Convert operations
Cherry Mui [Mon, 29 Dec 2025 15:51:50 +0000 (10:51 -0500)]
simd/archsimd: add more tests for Convert operations

Now include operations with input and output with different
lengths.

Change-Id: Idd5b88e67fa943a35a307e00e3348a20d79120a8
Reviewed-on: https://go-review.googlesource.com/c/go/+/733060
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2 months agosimd/archsimd: add more tests for Truncate operations
Cherry Mui [Sat, 27 Dec 2025 19:21:37 +0000 (14:21 -0500)]
simd/archsimd: add more tests for Truncate operations

Now include operations with input and output with different
lengths.

Change-Id: I5c9759e31ffae2d621a13f9cb3f5dd64e87a1c44
Reviewed-on: https://go-review.googlesource.com/c/go/+/732920
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
2 months agoreflect: document Call/CallSlice panic when v is unexported field
qiulaidongfeng [Sat, 26 Jul 2025 05:44:12 +0000 (13:44 +0800)]
reflect: document Call/CallSlice panic when v is unexported field

Fixes #74377

Change-Id: I250d67ef2a4bf4dac939be669eeaf1091523ac06
Reviewed-on: https://go-review.googlesource.com/c/go/+/690617
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 months agointernal/coverage/decodemeta: correct wording in unknown version error
jjpinto [Wed, 24 Dec 2025 17:39:35 +0000 (17:39 +0000)]
internal/coverage/decodemeta: correct wording in unknown version error

Correct the wording in the error message returned by readFileHeader when
encountering a meta-data file with an unsupported version.

Change-Id: I49be1bb1509ccc64e8384103bd7f19382b536c26
GitHub-Last-Rev: 2ab8e05a21443c45635e42d788946bec2478ca99
GitHub-Pull-Request: golang/go#76981
Reviewed-on: https://go-review.googlesource.com/c/go/+/732581
Reviewed-by: Roland Shoemaker <roland@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@golang.org>
2 months agoencoding/gob: clarify docs about pointers to zero values not being sent
Oleg Zaytsev [Fri, 26 Dec 2025 20:11:01 +0000 (20:11 +0000)]
encoding/gob: clarify docs about pointers to zero values not being sent

The documentation on encoding/gob mentions that pointers are flattened,
and it also explicitly says that empty values are not sent.

A corollary of this, is that pointers to zero values are not sent, i.e.,
gob-encoding of *false becomes nil on the receiver side.

It is worth documenting this explicitly.

Change-Id: I1909203b8972e20791144bdda22e5f1b466aad97
GitHub-Last-Rev: 57764ec235ffe48484be98d3ed5269f0102ca4f8
GitHub-Pull-Request: golang/go#77009
Reviewed-on: https://go-review.googlesource.com/c/go/+/732820
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Reviewed-by: Cherry Mui <cherryyz@google.com>
2 months agoregexp: standardize error message format in find_test.go
jjpinto [Fri, 26 Dec 2025 17:13:09 +0000 (17:13 +0000)]
regexp: standardize error message format in find_test.go

This change updates the test error messages in find_test.go to follow
the Go standard 'got, want' format.

It also replaces 'expected/should be' terminology with the project's
preferred style and improves the clarity of failure logs by using %q
to quote string values.

Change-Id: I17bfc60a06a879ce5e2c64d624c636e2c24135e9
GitHub-Last-Rev: e9613ac28cdce2fc16672b4aa42636b01ae0a80c
GitHub-Pull-Request: golang/go#77005
Reviewed-on: https://go-review.googlesource.com/c/go/+/732780
Auto-Submit: Keith Randall <khr@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>