aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-07-12[release-branch.go1.19] go1.19rc2go1.19rc2Gopher Robot
Change-Id: I1dbe540826135c2f25e2efc49e384b9ec892a72c Reviewed-on: https://go-review.googlesource.com/c/go/+/417179 Auto-Submit: Gopher Robot <gobot@golang.org> Run-TryBot: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-12[release-branch.go1.19] all: merge master (b2b8872) into release-branch.go1.19Michael Anthony Knyszek
Merge List: + 2022-07-12 b2b8872c87 compress/gzip: fix stack exhaustion bug in Reader.Read + 2022-07-12 ac68c6c683 path/filepath: fix stack exhaustion in Glob + 2022-07-12 fa2d41d0ca io/fs: fix stack exhaustion in Glob + 2022-07-12 6fa37e98ea encoding/gob: add a depth limit for ignored fields + 2022-07-12 695be961d5 go/parser: limit recursion depth + 2022-07-12 08c46ed43d encoding/xml: use iterative Skip, rather than recursive + 2022-07-12 c4c1993fd2 encoding/xml: limit depth of nesting in unmarshal + 2022-07-12 913d05133c cmd/go: avoid spurious readdir during fsys.Walk + 2022-07-12 d3d7998756 net/http: clarify that MaxBytesReader returns *MaxBytesError + 2022-07-11 126c22a098 syscall: gofmt after CL 412114 + 2022-07-11 123a6328b7 internal/trace: don't report regions on system goroutines + 2022-07-11 846490110a runtime/race: update amd64 syso images to avoid sse4 + 2022-07-11 b75ad09cae cmd/trace: fix typo in web documentation + 2022-07-11 7510e597de cmd/go: make module index loading O(1) + 2022-07-11 b8bf820d5d cmd/nm: don't rely on an erroneous install target in tests + 2022-07-11 ad641e8521 misc/cgo/testcarchive: don't rely on an erroneous install target in tests + 2022-07-11 bf5898ef53 net/url: use EscapedPath for url.JoinPath + 2022-07-11 398dcd1cf0 database/sql: make TestTxContextWaitNoDiscard test more robust + 2022-07-11 f956941b0f cmd/go: use package index for std in load.loadPackageData + 2022-07-11 59ab6f351a net/http: remove Content-Encoding in writeNotModified + 2022-07-08 c1a4e0fe01 cmd/compile: fix libfuzzer instrumentation line number + 2022-07-08 5c1a13e7a4 cmd/go: avoid setting variables for '/' and ':' in TestScript subprocess environments + 2022-07-08 180bcad33d net/http: wait for listeners to exit in Server.Close and Shutdown + 2022-07-08 14abe8aa73 cmd/compile: don't convert to interface{} for un-comparable types in generic switch + 2022-07-07 1ebc983000 runtime: overestimate the amount of allocated memory in heapLive + 2022-07-07 c177d9d98a crypto/x509: restrict CRL number to <=20 octets + 2022-07-07 486fc01770 crypto/x509: correctly parse CRL entry extensions + 2022-07-07 8ac58de185 crypto/x509: populate Number and AKI of parsed CRLs + 2022-07-07 0c7fcf6bd1 cmd/link: explicitly disable PIE for windows/amd64 -race mode + 2022-07-07 eaf2125654 cmd/go: default to "exe" build mode for windows -race + 2022-07-06 1243ec9c17 cmd/compile: only check implicit dots for method call enabled by a type bound + 2022-07-06 c391156f96 cmd/go: set up git identity for build_buildvcs_auto.txt Change-Id: Ib2b544e080fc7fce20614d4ed310767c2591931f
2022-07-12compress/gzip: fix stack exhaustion bug in Reader.ReadTatiana Bradley
Replace recursion with iteration in Reader.Read to avoid stack exhaustion when there are a large number of files. Fixes CVE-2022-30631 Fixes #53168 Change-Id: I47d8afe3f2d40b0213ab61431df9b221794dbfe0 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1455673 Reviewed-by: Roland Shoemaker <bracewell@google.com> Reviewed-by: Julie Qiu <julieqiu@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/417067 Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-12path/filepath: fix stack exhaustion in GlobJulie Qiu
A limit is added to the number of path separators allowed by an input to Glob, to prevent stack exhaustion issues. Thanks to Juho Nurminen of Mattermost who reported the issue. Fixes CVE-2022-30632 Fixes #53416 Change-Id: I1b9fd4faa85411a05dbc91dceae1c0c8eb021f07 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1498176 Reviewed-by: Roland Shoemaker <bracewell@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/417066 Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com>
2022-07-12io/fs: fix stack exhaustion in GlobJulie Qiu
A limit is added to the number of path separators allowed by an input to Glob, to prevent stack exhaustion issues. Thanks to Juho Nurminen of Mattermost who reported a similar issue in path/filepath. Fixes CVE-2022-30630 Fixes golang/go#53415 Change-Id: I5a9d02591fed90cd3d52627f5945f1301e53465d Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1497588 Reviewed-by: Roland Shoemaker <bracewell@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/417065 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-07-12encoding/gob: add a depth limit for ignored fieldsRoland Shoemaker
Enforce a nesting limit of 10,000 for ignored fields during decoding of messages. This prevents the possibility of triggering stack exhaustion. Fixes #53615 Fixes CVE-2022-30635 Change-Id: I05103d06dd5ca3945fcba3c1f5d3b5a645e8fb0f Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1484771 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Tatiana Bradley <tatianabradley@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/417064 Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Tatiana Bradley <tatiana@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com>
2022-07-12go/parser: limit recursion depthRoland Shoemaker
Limit nested parsing to 100,000, which prevents stack exhaustion when parsing deeply nested statements, types, and expressions. Also limit the scope depth to 1,000 during object resolution. Thanks to Juho Nurminen of Mattermost for reporting this issue. Fixes #53616 Fixes CVE-2022-1962 Change-Id: I4d7b86c1d75d0bf3c7af1fdea91582aa74272c64 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1491025 Reviewed-by: Russ Cox <rsc@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/417063 Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-12encoding/xml: use iterative Skip, rather than recursiveRoland Shoemaker
Prevents exhausting the stack limit in _incredibly_ deeply nested structures. Fixes #53614 Fixes CVE-2022-28131 Change-Id: I47db4595ce10cecc29fbd06afce7b299868599e6 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1419912 Reviewed-by: Julie Qiu <julieqiu@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/417062 Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-12encoding/xml: limit depth of nesting in unmarshalRoland Shoemaker
Prevent exhausting the stack limit when unmarshalling extremely deeply nested structures into nested types. Fixes #53611 Fixes CVE-2022-30633 Change-Id: Ic6c5d41674c93cfc9a316135a408db9156d39c59 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1421319 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Julie Qiu <julieqiu@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/417061 Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-12cmd/go: avoid spurious readdir during fsys.WalkRuss Cox
fsys.Walk is cloned from filepath.Walk, which has always handled a walk of a directory by reading the full directory before calling the callback on the directory itself. So if the callback returns fs.SkipDir, those entries are thrown away, but the expense of reading them was still incurred. (Worse, this is the expensive directory read that also calls Stat on every entry.) On machines with slow file system I/O, these reads are particularly annoying. For example, if I do go list m... there is a call to filepath.Walk that is told about $GOROOT/src/archive and responds by returning filepath.SkipDir because archive does not start with m, but it only gets the chance to do that after the archive directory has been read. (Same for all the other top-level directories.) Even something like go list github.com/foo/bar/... reads every top-level $GOPATH/src directory. When we designed filepath.WalkDir, one of the changes we made was to allow calling the callback twice for a directory: once before reading it, and then possibly again if the read produces an error (uncommon). This CL changes fsys.Walk to use that same model. None of the callbacks need changing, but now the $GOROOT/src/archive and other top-level directories won't be read when evaluating a pattern like 'm...'. For #53577. Fixes #53765. Change-Id: Idfa3b9e2cc335417bfd9d66dd584cb16f92bd12e Reviewed-on: https://go-review.googlesource.com/c/go/+/416179 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-12net/http: clarify that MaxBytesReader returns *MaxBytesErrorDamien Neil
A MaxBytesReader returns a *MaxBytesError when reading beyond its limit, not a MaxBytesError. Fixes #53764. Change-Id: Icac3aeac96fd8b172f951241f8f111cda633752c Reviewed-on: https://go-review.googlesource.com/c/go/+/416914 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-11syscall: gofmt after CL 412114Tobias Klauser
Change-Id: Ie51545eaebd22a31379bf8814a2c62b91d1d105b Reviewed-on: https://go-review.googlesource.com/c/go/+/416934 Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-07-11internal/trace: don't report regions on system goroutinesMichael Pratt
If a goroutine is started within a user region, internal/trace assigns the child goroutine a nameless region for its entire lifetime which is assosciated the same task as the parent's region. This is not strictly necessary: a child goroutine is not necessarily related to the task unless it performs some task operation (in which case it will be associated with the task through the standard means). However, it can be quite handy to see child goroutines within a region, which may be child worker goroutines that you simply didn't perform task operations on. If the first GC occurs during a region, the GC worker goroutines will also inherit a child region. We know for sure that these aren't related to the task, so filter them out from the region list. Note that we can't exclude system goroutines from setting activeRegions in EvGoCreate handling, because we don't know the goroutine start function name until the first EvGoStart. Fixes #53784. Change-Id: Ic83d84e23858a8400a76d1ae2f1418ef49951178 Reviewed-on: https://go-review.googlesource.com/c/go/+/416858 Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-07-11runtime/race: update amd64 syso images to avoid sse4Than McIntosh
Rebuild selected amd64 syso images with updated LLVM build rules that avoid the use of SSE4, so as to ensure that the Go race detector continues to work on older x86 cpus. No changes to the syso files for openbsd/amd64 (upstream support has been removed in LLVM) or netbsd/amd64 (work still in progress there). Fixes #53743. Change-Id: I738ae4d1e0528c6e06dd4ddb78e7039a30a51779 Reviewed-on: https://go-review.googlesource.com/c/go/+/416857 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Than McIntosh <thanm@google.com>
2022-07-11cmd/trace: fix typo in web documentationTobias Klauser
Change-Id: I950224c3f698fbdf2bcab6f847f4afddaa6e9c2d Reviewed-on: https://go-review.googlesource.com/c/go/+/416974 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Alan Donovan <adonovan@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Alan Donovan <adonovan@google.com>
2022-07-11cmd/go: make module index loading O(1)Russ Cox
For a large module, opening the index was populating tables with entries for every package in the module. If we are only using a small number of those packages, this is wasted work that can dwarf the benefit from the index. This CL changes the index reader to avoid loading all packages at module index open time. It also refactors the code somewhat for clarity. It also removes some duplication by defining that a per-package index is a per-module index containing a single package, rather than having two different formats and two different decoders. It also changes the string table to use uvarint-prefixed data instead of having to scan for a NUL byte. This makes random access to long strings more efficient - O(1) instead of O(n) - and can significantly speed up the strings.Compare operation in the binary search looking for a given package. Also add a direct test of the indexing code. For #53577. Change-Id: I7428d28133e4e7fe2d2993fa014896cd15af48af Reviewed-on: https://go-review.googlesource.com/c/go/+/416178 Reviewed-by: Bryan Mills <bcmills@google.com>
2022-07-11cmd/nm: don't rely on an erroneous install target in testsBryan C. Mills
Non-main packages in module mode should not be installed to GOPATH/pkg, but due to #37015 they were installed there anyway. This change switches the 'go install' command in testGoLib to instead use 'go build -buildmode=archive' with an explicit output file. For #37015. Change-Id: I15781aa33d1b2adc6a4437a58622276f4e20b889 Reviewed-on: https://go-review.googlesource.com/c/go/+/416955 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com>
2022-07-11misc/cgo/testcarchive: don't rely on an erroneous install target in testsBryan C. Mills
Non-main packages in module mode should not be installed to GOPATH/pkg, but due to #37015 they were installed there anyway. This change switches the 'go install' command in TestPIE to instead use 'go build', and switches TestInstall and TestCachedInstall (which appear to be explicitly testing 'go install') to explicitly request GOPATH mode (which does have a well-defined install target). For #37015. Change-Id: Ifb24657d2781d1e35cf40078e8e3ebf56aab9cc8 Reviewed-on: https://go-review.googlesource.com/c/go/+/416954 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-07-11net/url: use EscapedPath for url.JoinPathSean Liao
Fixes #53763 Change-Id: I08b53f159ebdce7907e8cc17316fd0c982363239 Reviewed-on: https://go-review.googlesource.com/c/go/+/416774 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org>
2022-07-11database/sql: make TestTxContextWaitNoDiscard test more robustDmitri Goutnik
Similar to CL 385934, rely on waiter trigger instead of the WAIT query prefix and factor out the common test code. Fixes #53222 Change-Id: I46efc85ca102b350bb4dbe8e514921e016870ffb Reviewed-on: https://go-review.googlesource.com/c/go/+/416655 Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> Run-TryBot: Dmitri Goutnik <dgoutnik@gmail.com> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-07-11cmd/go: use package index for std in load.loadPackageDataRuss Cox
load.loadPackageData was only using an index for modules, not for standard library packages. Other parts of the code were using the index, so there was some benefit, but not as much as you'd hope. With the index disabled, the Script/work test takes 2.2s on my Mac. With the index enabled before this CL, it took 2.0s. With the index enabled after this CL, it takes 1.6s. Before this CL, the Script/work test issued: 429 IsDir 19 IsDirWithGoFiles 7 Lstat 9072 Open 993 ReadDir 256 Stat 7 Walk 3 indexModule 24 openIndexModule 525 openIndexPackage After this CL, it issued: 19 IsDirWithGoFiles 7 Lstat 60 Open 606 ReadDir 256 Stat 7 Walk 3 indexModule 24 openIndexModule 525 openIndexPackage This speedup helps the Dragonfly builder, which has very slow file I/O and is timing out since a recent indexing change. Times for go test -run=Script/^work$ on the Dragonfly builder: 50s before indexing changes 31s full module indexing of std 46s per-package indexing of std It cuts the time for go test -run=Script/^work$ from 44s to 20s. For #53577. Change-Id: I7189a77fc7fdf61de3ab3447efc4e84d1fc52c25 Reviewed-on: https://go-review.googlesource.com/c/go/+/416134 Reviewed-by: Bryan Mills <bcmills@google.com>
2022-07-11net/http: remove Content-Encoding in writeNotModifiedMitar
Additional header to remove if set before calling http.ServeContent. The API of ServeContent is that one should set Content-Encoding before calling it, if the content is encoded (e.g., compressed). But then, if content has not been modified, that header should be removed, according to RFC 7232 section 4.1. Change-Id: If51b35b7811a4dbb19de2ddb73f40c5e68fcec7e GitHub-Last-Rev: 53df6e73c44b63f351f7aeeb45cab82d706311eb GitHub-Pull-Request: golang/go#50903 Reviewed-on: https://go-review.googlesource.com/c/go/+/381955 Run-TryBot: hopehook <hopehook@qq.com> Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com>
2022-07-08cmd/compile: fix libfuzzer instrumentation line numberKeith Randall
Set a reasonable starting line number before processing the body of the function in the order pass. We update base.Pos each time we process a node, but some of the libfuzzer instrumentation is added before we process any node, so the base.Pos used is junk. Fixes #53688 Change-Id: I3654b805eabb8866a9a1574845ef4ff062797319 Reviewed-on: https://go-review.googlesource.com/c/go/+/416654 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-08cmd/go: avoid setting variables for '/' and ':' in TestScript subprocess ↵Bryan C. Mills
environments Also simplify platform-dependent handling of the PATH variable, to make it more like the existing platform-dependent handling for HOME and TMPDIR. Fixes #53671. Change-Id: Ica2665d3f61988c66fb6982b9feb61ca48eced79 Reviewed-on: https://go-review.googlesource.com/c/go/+/416554 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-08net/http: wait for listeners to exit in Server.Close and ShutdownDamien Neil
Avoid race conditions when a new connection is accepted just after Server.Close or Server.Shutdown is called by waiting for the listener goroutines to exit before proceeding to clean up active connections. No test because the mechanism required to trigger the race condition reliably requires such tight coupling to the Server internals that any test would be quite fragile in the face of reasonable refactorings. Fixes #48642 Updates #33313, #36819 Change-Id: I109a93362680991bf298e0a95637595dcaa884af Reviewed-on: https://go-review.googlesource.com/c/go/+/409537 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Damien Neil <dneil@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-07-08cmd/compile: don't convert to interface{} for un-comparable types in generic ↵Cuong Manh Le
switch Fixes #53635 Change-Id: I41f383be8870432fc0d29fa83687911ddd8217f1 Reviewed-on: https://go-review.googlesource.com/c/go/+/415634 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-07-07runtime: overestimate the amount of allocated memory in heapLiveMichael Anthony Knyszek
CL 377516 made it so that memory metrics are truly monotonic, but also updated how heapLive tracked allocated memory to also be monotonic. The result is that cached spans with allocated memory aren't fully accounted for by the GC, causing it to make a worse assumption (the exact mechanism is at this time unknown), resulting in a memory regression, especially for smaller heaps. This change is a partial revert of CL 377516 that makes heapLive a non-monotonic overestimate again, which appears to resolve the regression. For #53738. Change-Id: I5c51067abc0b8e0a6b89dd8dbd4a0be2e8c0c1b2 Reviewed-on: https://go-review.googlesource.com/c/go/+/416417 Reviewed-by: Michael Pratt <mpratt@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-07crypto/x509: restrict CRL number to <=20 octetsRoland Shoemaker
Similar to certificate serial numbers, RFC 5280 restricts the length of the CRL number field to no more than 20 octets. Enforce this in CreateRevocationList. Fixes #53543 Change-Id: If392ef6b0844db716ae9ee6ef317135fceab039c Reviewed-on: https://go-review.googlesource.com/c/go/+/415134 Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Tatiana Bradley <tatiana@golang.org> Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org>
2022-07-07crypto/x509: correctly parse CRL entry extensionsAaron Gable
When checking to see if a CRL entry has any extensions, attempt to read them from the individual revokedCertificate, rather than from the parent TBSCertList. Additionally, crlEntryExtensions is not an EXPLICIT field (c.f. crlExtension and Certificate extensions), so do not perform an extra layer of unwrapping when parsing the field. The added test case fails without the accompanying changes. Fixes #53592 Change-Id: Icc00e4c911f196aef77e3248117de64ddc5ea27f Reviewed-on: https://go-review.googlesource.com/c/go/+/414877 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-07crypto/x509: populate Number and AKI of parsed CRLsAaron Gable
The x509.RevocationList type has two fields which correspond to extensions, rather than native fields, of the underlying ASN.1 CRL: the .Number field corresponds to the crlNumber extension, and the .AuthorityKeyId field corresponds to the authorityKeyIdentifier extension. The x509.CreateRevocationList() function uses these fields to populate their respective extensions in the resulting CRL. However, the x509.ParseRevocationList() function does not perform the reverse operation: the fields retain their zero-values even after parsing a CRL which contains the relevant extensions. Add code which populates these fields when parsing their extensions. Add assertions to the existing tests to confirm that the values are populated appropriately. Fixes #53726 Change-Id: Ie5b71081e53034e0b5b9ff3c122065c62f15cf23 Reviewed-on: https://go-review.googlesource.com/c/go/+/416354 Run-TryBot: Roland Shoemaker <roland@golang.org> Auto-Submit: Roland Shoemaker <roland@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Damien Neil <dneil@google.com>
2022-07-07cmd/link: explicitly disable PIE for windows/amd64 -race modeThan McIntosh
Turn off PIE explicitly for windows/amd64 when -race is in effect, since at the moment the race detector runtime doesn't seem to handle PIE binaries correctly. Note that newer C compilers on windows produce PIE binaries by default, so the Go linker needs to explicitly turn off PIE when invoking the external linker in this case. Updates #53539. Change-Id: Ib990621f22cf61a5fa383584bab81d3dfd7552e8 Reviewed-on: https://go-review.googlesource.com/c/go/+/415676 Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2022-07-07cmd/go: default to "exe" build mode for windows -raceThan McIntosh
This patch changes the default build mode from "pie" to "exe" when building programs on windows with "-race" in effect. The Go command already issues an error if users explicitly ask for -buildmode=pie in combination with -race on windows, but wasn't revising the default "pie" build mode if a specific buildmode was not requested. Updates #53539. Updates #35006. Change-Id: I2f81a41a1d15a0b4f5ae943146175c5a1202cbe0 Reviewed-on: https://go-review.googlesource.com/c/go/+/416174 Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Than McIntosh <thanm@google.com>
2022-07-06[release-branch.go1.19] go1.19rc1go1.19rc1Gopher Robot
Change-Id: I85a6dcfda4fd6b871959e0ba8498a5b85c3c557e Reviewed-on: https://go-review.googlesource.com/c/go/+/416314 Run-TryBot: Gopher Robot <gobot@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Reviewed-by: David Chase <drchase@google.com>
2022-07-06cmd/compile: only check implicit dots for method call enabled by a type boundCuong Manh Le
Fixes #53419 Change-Id: Ibad64f5c4af2112deeb0a9ecc9c589b17594bd05 Reviewed-on: https://go-review.googlesource.com/c/go/+/414836 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
2022-07-06[release-branch.go1.19] update codereview.cfg for release-branch.go1.19Heschi Kreinick
Following go.dev/cl/334376. Change-Id: I7e5e1b89243d1980274d27be5362acf8034998ef Reviewed-on: https://go-review.googlesource.com/c/go/+/416176 Run-TryBot: Heschi Kreinick <heschi@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-06cmd/go: set up git identity for build_buildvcs_auto.txtDaniel Martí
Just like in other tests like get_dotfiles.txt or version_buildvcs_git.txt. Without it, I get a failure on my machine: fatal: empty ident name (for <mvdan@p14s.localdomain>) not allowed Change-Id: I1c17c0d58c539b59154570b5438c7bd850bac5aa Reviewed-on: https://go-review.googlesource.com/c/go/+/416095 Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Daniel Martí <mvdan@mvdan.cc> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-07-06cmd/compile: rework induction variable detectorKeith Randall
Induction variable detection is still not quite right. I've added another failing test. Redo the overflow/underflow detector so it is more obviously correct. Update #53600 Fixes #53653 Fixes #53663 Change-Id: Id95228e282fdbf6bd80b26e1c41d62e935ba08ff Reviewed-on: https://go-review.googlesource.com/c/go/+/415874 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: David Chase <drchase@google.com>
2022-07-06os/exec: clarify that Wait must be calledIan Lance Taylor
Fixes #52580 Change-Id: Ib2dd8a793b9c6fcb083abb3f7c346f6279adefc9 Reviewed-on: https://go-review.googlesource.com/c/go/+/414056 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Alan Donovan <adonovan@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-07-06cmd/internal/notsha256: add purego tag as neededIan Lance Taylor
This permits building the package with gccgo, when using gccgo as a bootstrap compiler. Fixes #53662 Change-Id: Ic7ae9323ec5954e9306a32e1160e9aa1ed3aa202 Reviewed-on: https://go-review.googlesource.com/c/go/+/415935 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com>
2022-07-06cmd/dist: use purego tag when building the bootstrap binariesIan Lance Taylor
This is in addition to the current math_big_pure_go tag. Using purego ensures that we can build the cmd binaries with gccgo. For #53662 Change-Id: Ib82f8bf10659b5f94935f2b427ae8b2da875cd3b Reviewed-on: https://go-review.googlesource.com/c/go/+/415934 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-07-06misc/cgo/test: make TestSetgidStress cheaperCherry Mui
TestSetgidStress spawns 1000 threads, which can be expensive on some platforms or slow builders. Run with 50 threads in short mode instead. This makes the failure less reproducible even with buggy code. But one can manually stress test it (e.g. when a flaky failure appear on the builder). Fixes #53641. Change-Id: I33b5ea5ecaa8c7a56f59c16f9171657ee295db47 Reviewed-on: https://go-review.googlesource.com/c/go/+/415677 Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-07-06test: recognize new gofrontend error messageIan Lance Taylor
The new gofrontend message matches other gofrontend error messages, so adjust the test to accept it. For #27938 For #51237 Change-Id: I29b536f83a0cf22b1dbdae9abc2f5f6cf21d522d Reviewed-on: https://go-review.googlesource.com/c/go/+/416014 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
2022-07-05cmd/compile: drop "buildcfg" from no instrument packagesMichael Pratt
Package buildcfg was added to this list by CL 403851, but package buildcfg does not exist. This was probably intended to refer to internal/buildcfg, but internal/buildcfg is only used by the compiler so it is not clear why it couldn't be instrumented. For #44853. Change-Id: Iad2517358be79c3eabf240376156bcff0c4bcefc Reviewed-on: https://go-review.googlesource.com/c/go/+/414516 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Pratt <mpratt@google.com>
2022-07-05cmd/go: make module@nonexistentversion failures reusableRuss Cox
CL 411398 added the -reuse flag for reusing cached JSON output when the remote Git repository has not changed. One case that was not yet cached is a lookup of a nonexistent version. This CL adds caching of failed lookups of nonexistent versions, by saving a checksum of all the heads and tags refs on the remote server (we never consider other kinds of refs). If none of those have changed, then we don't need to download the full server. Fixes #53644. Change-Id: I428bbc8ec8475bd7d03788934d643e1e2be3add0 Reviewed-on: https://go-review.googlesource.com/c/go/+/415678 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-05cmd/go: add -reuse flag to make proxy invocations more efficientRuss Cox
The go list -m and go mod download commands now have a -reuse flag, which is passed the name of a file containing the JSON output from a previous run of the same command. (It is up to the caller to ensure that flags such as -versions or -retracted, which affect the output, are consistent between the old and new run.) The new run uses the old JSON to evaluate whether the answer is unchanged since the old run. If so, it reuses that information, avoiding a costly 'git fetch', and sets a new Reuse: true field in its own JSON output. This dance with saving the JSON output and passing it back to -reuse is not necessary on most systems, because the go command caches version control checkouts in the module cache. That cache means that a new 'git fetch' would only download the commits that are new since the previous one (often none at all). The dance becomes important only on systems that do not preserve the module cache, for example by running 'go clean -modcache' aggressively or by running in some environment that starts with an empty file system. For #53644. Change-Id: I447960abf8055f83cc6dbc699a9fde9931130004 Reviewed-on: https://go-review.googlesource.com/c/go/+/411398 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-07-05cmd/go: record origin metadata during module downloadRuss Cox
This change adds an "Origin" JSON key to the output of go list -json -m and go mod download -json. The associated value is a JSON object with metadata about the source control system. For Git, that metadata is sufficient to evaluate whether the remote server has changed in any interesting way that might invalidate the cached data. In most cases, it will not have, and a fetch could then avoid downloading a full repo from the server. This origin metadata is also now recorded in the .info file for a given module@version, for informational and debugging purposes. This change only adds the metadata. It does not use it to optimize away unnecessary git fetch operations. (That's the next change.) For #53644. Change-Id: I4a1712a2386d1d8ab4e02ffdf0f72ba75d556115 Reviewed-on: https://go-review.googlesource.com/c/go/+/411397 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
2022-07-04build/constraint: update doc to mention a feature added in Go 1.17Cristian Greco
The pkg documentation mentions that the "//go:build" syntax "will be" added in Go 1.17. In fact, it has been added in that Go release, so the documentation can now be updated. Change-Id: I72f24063c3be62d97ca78bf724d56599f5f19460 GitHub-Last-Rev: 4371886f6ce9f2c2a370df047a5baa1f122c681f GitHub-Pull-Request: golang/go#53647 Reviewed-on: https://go-review.googlesource.com/c/go/+/415774 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Benny Siegert <bsiegert@gmail.com> Auto-Submit: Ian Lance Taylor <iant@google.com>
2022-07-04runtime: pass correct string to exits on Plan 9Ori Bernstein
In CL 405901 the definition of exit in the Plan 9 go runtime was changed like so: - status = append(itoa(tmp[:len(tmp)-1], uint64(e)), 0) + sl := itoa(tmp[:len(tmp)-1], uint64(e)) + // Don't append, rely on the existing data being zero. + status = tmp[:len(sl)+1] However, itoa only puts the converted number "somewhere" in the buffer. Specifically, it builds it from the end of the buffer towards the start, meaning the first byte of the buffer is a 0 byte, and the resulting string that's passed to exits is empty, leading to a falsely successful exit. This change uses the returned value from itoa, rather than the buffer that was passed in, so that we start from the correct location in the string. Fixes #53669 Change-Id: I63f0c7641fc6f55250857dc17a1eeb12ae0c2e10 Reviewed-on: https://go-review.googlesource.com/c/go/+/415680 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-07-01net/http: omit invalid header value from error messageAlexander Yastrebov
Updates #43631 Change-Id: I0fe3aafdf7ef889fed1a830128721393f8d020e6 GitHub-Last-Rev: c359542d741b17f4e2cb0d50982bf341246233b0 GitHub-Pull-Request: golang/go#48979 Reviewed-on: https://go-review.googlesource.com/c/go/+/355929 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-01cmd/go, go/build: clarify build constraint docsIan Lance Taylor
Clarify that the //go:build line is an expression of constraints, not a constraint itself. Fixes #53308 Change-Id: Ib67243c6ee5cfe3b688c12b943b5e7496f686035 Reviewed-on: https://go-review.googlesource.com/c/go/+/411697 Reviewed-by: Rob Pike <r@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: David Chase <drchase@google.com>