aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2020-08-06[release-branch.go1.13] all: merge release-branch.go1.13-security into ↵release-branch.go1.13Katie Hockman
release-branch.go1.13 Change-Id: Ib8a4c5f58de71145525ba23562bf8a0c35b60c9c
2020-08-06[release-branch.go1.13-security] go1.13.15go1.13.15Alexander Rakoczy
Change-Id: I4922f24774168f1c991b486276257a1ed18d34b6 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/814547 Reviewed-by: Katie Hockman <katiehockman@google.com>
2020-08-06[release-branch.go1.13-security] encoding/binary: read at most ↵Katie Hockman
MaxVarintLen64 bytes in ReadUvarint This CL ensures that ReadUvarint consumes only a limited amount of input (instead of an unbounded amount). On some inputs, ReadUvarint could read an arbitrary number of bytes before deciding to return an overflow error. After this CL, ReadUvarint returns that same overflow error sooner, after reading at most MaxVarintLen64 bytes. Fix authored by Robert Griesemer and Filippo Valsorda. Thanks to Diederik Loerakker, Jonny Rhea, Raúl Kripalani, and Preston Van Loon for reporting this. Fixes CVE-2020-16845 Change-Id: Ie0cb15972f14c38b7cf7af84c45c4ce54909bb8f Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/812099 Reviewed-by: Filippo Valsorda <valsorda@google.com> Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/812324
2020-08-03[release-branch.go1.13] cmd/compile: don't addLocalInductiveFacts if there ↵Keith Randall
is no direct edge from if block to phi block Currently in addLocalInductiveFacts, we only check whether direct edge from if block to phi block exists. If not, the following logic will treat the phi block as the first successor, which is wrong. This patch makes prove pass more conservative, so we disable some cases in test/prove.go. We will do some optimization in the following CL and enable these cases then. Fixes #40500. Change-Id: I27cf0248f3a82312a6f7dabe11c79a1a34cf5412 Reviewed-on: https://go-review.googlesource.com/c/go/+/244579 Reviewed-by: Zach Jones <zachj1@gmail.com> Reviewed-by: Keith Randall <khr@golang.org> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/245957 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
2020-07-16[release-branch.go1.13] go1.13.14go1.13.14Andrew Bonventre
Change-Id: Id54fd93e1839c28e40e9fcdaa5e7304dae274565 Reviewed-on: https://go-review.googlesource.com/c/go/+/243139 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-07-16[release-branch.go1.13] database/sql: backport 5 Tx rollback related CLsEmmanuel T Odeke
Manually backported the subject CLs, because of lack of Gerrit "forge-author" permissions, but also because the prior cherry picks didn't apply cleanly, due to a tight relation chain. The backport comprises of: * CL 174122 * CL 216197 * CL 223963 * CL 216240 * CL 216241 Note: Due to the restrictions that we cannot retroactively introduce API changes to Go1.13.13 that weren't in Go1.13, the Conn.Validator interface (from CL 174122, CL 223963) isn't exposed, and drivers will just be inspected, for if they have an IsValid() bool method implemented. For a description of the content of each CL: * CL 174122: database/sql: process all Session Resets synchronously Adds a new interface, driver.ConnectionValidator, to allow drivers to signal they should not be used again, separatly from the session resetter interface. This is done now that the session reset is done after the connection is put into the connection pool. Previous behavior attempted to run Session Resets in a background worker. This implementation had two problems: untested performance gains for additional complexity, and failures when the pool size exceeded the connection reset channel buffer size. * CL 216197: database/sql: check conn expiry when returning to pool, not when handing it out With the original connection reuse strategy, it was possible that when a new connection was requested, the pool would wait for an an existing connection to return for re-use in a full connection pool, and then it would check if the returned connection was expired. If the returned connection expired while awaiting re-use, it would return an error to the location requestiong the new connection. The existing call sites requesting a new connection was often the last attempt at returning a connection for a query. This would then result in a failed query. This change ensures that we perform the expiry check right before a connection is inserted back in to the connection pool for while requesting a new connection. If requesting a new connection it will no longer fail due to the connection expiring. * CL 216240: database/sql: prevent Tx statement from committing after rollback It was possible for a Tx that was aborted for rollback asynchronously to execute a query after the rollback had completed on the database, which often would auto commit the query outside of the transaction. By W-locking the tx.closemu prior to issuing the rollback connection it ensures any Tx query either fails or finishes on the Tx, and never after the Tx has rolled back. * CL 216241: database/sql: on Tx rollback, retain connection if driver can reset session Previously the Tx would drop the connection after rolling back from a context cancel. Now if the driver can reset the session, keep the connection. * CL 223963 database/sql: add test for Conn.Validator interface This addresses comments made by Russ after https://golang.org/cl/174122 was merged. It addes a test for the connection validator and renames the interface to just "Validator". Updates #31480 Updates #32530 Updates #32942 Updates #34775 Fixes #40205 Change-Id: I6d7307180b0db0bf159130d91161764cf0f18b58 Reviewed-on: https://go-review.googlesource.com/c/go/+/242522 Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Daniel Theophanes <kardianos@gmail.com>
2020-07-14[release-branch.go1.13] all: merge release-branch.go1.13-security into ↵Katie Hockman
release-branch.go1.13 Change-Id: Id0cca0e1006d92960e7f665d41111483c0fcea13
2020-07-14[release-branch.go1.13-security] go1.13.13go1.13.13Andrew Bonventre
Change-Id: I65f5d9cc1363d369ced4496c1d6d3d7f9144f1b8 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/794127 Reviewed-by: Katie Hockman <katiehockman@google.com>
2020-07-14[release-branch.go1.13-security] crypto/x509: respect ↵Filippo Valsorda
VerifyOptions.KeyUsages on Windows When using the platform verifier on Windows (because Roots is nil) we were always enforcing server auth EKUs if DNSName was set, and none otherwise. If an application was setting KeyUsages, they were not being respected. Started correctly surfacing IncompatibleUsage errors from the system verifier, as those are the ones applications will see if they are affected by this change. Also refactored verify_test.go to make it easier to add tests for this, and replaced the EKULeaf chain with a new one that doesn't have a SHA-1 signature. Thanks to Niall Newman for reporting this. Fixes #39360 Fixes CVE-2020-14039 Change-Id: If5c00d615f2944f7d57007891aae1307f9571c32 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/774414 Reviewed-by: Katie Hockman <katiehockman@google.com> Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/793509 Reviewed-by: Filippo Valsorda <valsorda@google.com>
2020-07-13[release-branch.go1.13-security] net/http: synchronize "100 Continue" write ↵Russ Cox
and Handler writes The expectContinueReader writes to the connection on the first Request.Body read. Since a Handler might be doing a read in parallel or before a write, expectContinueReader needs to synchronize with the ResponseWriter, and abort if a response already went out. The tests will land in a separate CL. Fixes #34902 Fixes CVE-2020-15586 Change-Id: Icdd8dd539f45e8863762bd378194bb4741e875fc Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/793350 Reviewed-by: Filippo Valsorda <valsorda@google.com> (cherry picked from commit b5e504f4a07c572744b228fa1b10e3989c4c44f3) Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/793499
2020-07-13[release-branch.go1.13] net/http: fix panic with If-None-Match value in ↵Marcus Weiner
http.ServeContent Updates #39817. Fixes #39925. Change-Id: I79f2ad7c836a8a46569f603aca583fdd526d22dc GitHub-Last-Rev: 5b88aada219aaa2af0c7e1969ed6fa646117d9da GitHub-Pull-Request: golang/go#39821 Reviewed-on: https://go-review.googlesource.com/c/go/+/239699 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit ce81a8f5e4f6c33036aa0777fabc47eeeab468dc) Reviewed-on: https://go-review.googlesource.com/c/go/+/242077 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Marcus Weiner <marcus.weiner@gmail.com> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2020-07-11[release-branch.go1.13] reflect: zero stack slots before writing to them ↵Keith Randall
with write barriers reflect.assignTo writes to the target using write barriers. Make sure that the memory it is writing to is zeroed, so the write barrier does not read pointers from uninitialized memory. Fixes #39697 Change-Id: Ia64b2cacc193bffd0c1396bbce1dfb8182d4905b Reviewed-on: https://go-review.googlesource.com/c/go/+/238760 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit 3dec253783e1211989102ac6abd34cddbf8ba0e6) Reviewed-on: https://go-review.googlesource.com/c/go/+/238862 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2020-07-10[release-branch.go1.13] cmd/compile: remove check that Zero's arg has the ↵Keith Randall
correct base type It doesn't have to. The type in the aux field is authoritative. There are cases involving casting from interface{} where pointers have a placeholder pointer type (because the type is not known when the IData op is generated). The check was introduced in CL 13447. Fixes #39848 Change-Id: Id77a57577806a271aeebd20bea5d92d08ee7aa6b Reviewed-on: https://go-review.googlesource.com/c/go/+/239817 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> (cherry picked from commit 3b2f67a59702e4881625cb967f853ef56b0c4828) Reviewed-on: https://go-review.googlesource.com/c/go/+/239998 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2020-06-29[release-branch.go1.13] cmd/go: convert TestBuildIDContainsArchModeEnv to ↵Michael Matloob
the script framework Part of converting all tests to script framework to improve test parallelism. Fixes #39823 Updates #36320 Updates #17751 Change-Id: I69c69809fb1698c8198ef3ea00103a9acb7b6ce7 Reviewed-on: https://go-review.googlesource.com/c/go/+/214387 Run-TryBot: Michael Matloob <matloob@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from CL 214387) Reviewed-on: https://go-review.googlesource.com/c/go/+/239777 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org>
2020-06-15[release-branch.go1.13] cmd: update golang.org/x/tools to ↵Dmitri Shuralyov
v0.0.0-20200615191743-991d59a616de This teaches vet to recognize the new formats %#b and %O on integers, %x on float/complex. They have been supported since the 1.13 release, but vet would warn about it. Also update cmd/vet testdata accordingly, as was done in CL 202083. Fixes #39287. For #29986. Change-Id: Ia7817ee60ae6beac32cc402c0c68afa917e4ef0f Reviewed-on: https://go-review.googlesource.com/c/go/+/238018 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
2020-06-12[release-branch.go1.13] net: add more timing slop for TestDialParallel on ↵Ian Lance Taylor
Windows For #35616. Fixes #39538. For #29252. Change-Id: I51b2490100cfe0e902da09eee8d027e0ec86ed53 Reviewed-on: https://go-review.googlesource.com/c/go/+/207466 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit c20b71eb37889e7257453be152a994319c76d451) Reviewed-on: https://go-review.googlesource.com/c/go/+/237602 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-06-12[release-branch.go1.13] cmd/compile/internal/ssa: skip TestNexting with old ↵Dmitri Shuralyov
Delve on linux/386 Support for linux/386 was added to Delve in version 1.4.1, but the version of Delve currently installed on the linux-386-longtest builder is 1.2.0. That isn't new enough, which causes the test to fail. Skip it on that builder until it can be made to work. The only reason it used to pass on the linux-386-longtest builder before is because that builder was misconfigured to run tests for linux/amd64. This was resolved in CL 234520. Also improve internal documentation and the text of skip reasons. For #39309. Fixes #39561. Change-Id: I395cb1f076e59dd3a3feb53e1dcdce5101e9a0f5 Reviewed-on: https://go-review.googlesource.com/c/go/+/237617 Reviewed-by: David Chase <drchase@google.com>
2020-06-01[release-branch.go1.13] go1.13.12go1.13.12Dmitri Shuralyov
Change-Id: I1989d7cab0bf75c4e42d1c48146be9131d2c105c Reviewed-on: https://go-review.googlesource.com/c/go/+/235918 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
2020-05-27[release-branch.go1.13] math/big: make Rat.Denom side-effect freeRobert Griesemer
A Rat is represented via a quotient a/b where a and b are Int values. To make it possible to use an uninitialized Rat value (with a and b uninitialized and thus == 0), the implementation treats a 0 denominator as 1. Rat.Num and Rat.Denom return pointers to these values a and b. Because b may be 0, Rat.Denom used to first initialize it to 1 and thus produce an undesirable side-effect (by changing the Rat's denominator). This CL changes Denom to return a new (not shared) *Int with value 1 in the rare case where the Rat was not initialized. This eliminates the side effect and returns the correct denominator value. While this is changing behavior of the API, the impact should now be minor because together with (prior) CL https://golang.org/cl/202997, which initializes Rats ASAP, Denom is unlikely used to access the denominator of an uninitialized (and thus 0) Rat. Any operation that will somehow set a Rat value will ensure that the denominator is not 0. Fixes #36689. For #33792. For #3521. Change-Id: I0bf15ac60513cf52162bfb62440817ba36f0c3fc Reviewed-on: https://go-review.googlesource.com/c/go/+/203059 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/233323 Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2020-05-27[release-branch.go1.13] math/big: normalize unitialized denominators ASAPRobert Griesemer
A Rat is represented via a quotient a/b where a and b are Int values. To make it possible to use an uninitialized Rat value (with a and b uninitialized and thus == 0), the implementation treats a 0 denominator as 1. For each operation we check if the denominator is 0, and then treat it as 1 (if necessary). Operations that create a new Rat result, normalize that value such that a result denominator 1 is represened as 0 again. This CL changes this behavior slightly: 0 denominators are still interpreted as 1, but whenever we (safely) can, we set an uninitialized 0 denominator to 1. This simplifies the code overall. Also: Improved some doc strings. Preparation for addressing issue #33792. For #36689. For #33792. Change-Id: I3040587c8d0dad2e840022f96ca027d8470878a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/202997 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/233322 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2020-05-27[release-branch.go1.13] math/big: make Rat accessors safe for concurrent useRobert Griesemer
Do not modify the underlying Rat denominator when calling one of the accessors Float32, Float64; verify that we don't modify the Rat denominator when calling Inv, Sign, IsInt, Num. For #36689. For #34919. For #33792. Change-Id: Ife6d1252373f493a597398ee51e7b5695b708df5 Reviewed-on: https://go-review.googlesource.com/c/go/+/201205 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/233321 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
2020-05-27[release-branch.go1.13] runtime: disable preemption in startTemplateThreadMichael Pratt
When a locked M wants to start a new M, it hands off to the template thread to actually call clone and start the thread. The template thread is lazily created the first time a thread is locked (or if cgo is in use). stoplockedm will release the P (_Pidle), then call handoffp to give the P to another M. In the case of a pending STW, one of two things can happen: 1. handoffp starts an M, which does acquirep followed by schedule, which will finally enter _Pgcstop. 2. handoffp immediately enters _Pgcstop. This only occurs if the P has no local work, GC work, and no spinning M is required. If handoffp starts an M, and must create a new M to do so, then newm will simply queue the M on newmHandoff for the template thread to do the clone. When a stop-the-world is required, stopTheWorldWithSema will start the stop and then wait for all Ps to enter _Pgcstop. If the template thread is not fully created because startTemplateThread gets stopped, then another stoplockedm may queue an M that will never get created, and the handoff P will never leave _Pidle. Thus stopTheWorldWithSema will wait forever. A sequence to trigger this hang when STW occurs can be visualized with two threads: T1 T2 ------------------------------- ----------------------------- LockOSThread LockOSThread haveTemplateThread == 0 startTemplateThread haveTemplateThread = 1 newm haveTemplateThread == 1 preempt -> schedule g.m.lockedExt++ gcstopm -> _Pgcstop g.m.lockedg = ... park g.lockedm = ... return ... (any code) preempt -> schedule stoplockedm releasep -> _Pidle handoffp startm (first 3 handoffp cases) newm g.m.lockedExt != 0 Add to newmHandoff, return park Note that the P in T2 is stuck sitting in _Pidle. Since the template thread isn't running, the new M will not be started complete the transition to _Pgcstop. To resolve this, we disable preemption around the assignment of haveTemplateThread and the creation of the template thread in order to guarantee that if handTemplateThread is set then the template thread will eventually exist, in the presence of stops. For #38931 Fixes #38932 Change-Id: I50535fbbe2f328f47b18e24d9030136719274191 Reviewed-on: https://go-review.googlesource.com/c/go/+/232978 Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 11b3730a02c93fd5745bfd977156541a9033759b) Reviewed-on: https://go-review.googlesource.com/c/go/+/234888 Reviewed-by: Cherry Zhang <cherryyz@google.com>
2020-05-14[release-branch.go1.13] go1.13.11go1.13.11Andrew Bonventre
Change-Id: I6fb5fbb3caf64e7d33412be4893edf8564e3a4de Reviewed-on: https://go-review.googlesource.com/c/go/+/234001 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-04-28[release-branch.go1.13] cmd/compile: fix deallocation of live value copies ↵Michael Munday
in regalloc When deallocating the input register to a phi so that the phi itself could be allocated to that register the code was also deallocating all copies of that phi input value. Those copies of the value could still be live and if they were the register allocator could reuse them incorrectly to hold speculative copies of other phi inputs. This causes strange bugs. No test because this is a very obscure scenario that is hard to replicate but CL 228060 adds an assertion to the compiler that does trigger when running the std tests on linux/s390x without this CL applied. Hopefully that assertion will prevent future regressions. Fixes #38442. Change-Id: Id975dadedd731c7bb21933b9ea6b17daaa5c9e1d Reviewed-on: https://go-review.googlesource.com/c/go/+/228061 Run-TryBot: Michael Munday <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> (cherry picked from commit 382fe3e2498f2066400e7e7007aa9903440e339d) Reviewed-on: https://go-review.googlesource.com/c/go/+/230358
2020-04-08[release-branch.go1.13] go1.13.10go1.13.10Andrew Bonventre
Change-Id: I1ed1bc6652724d2e365f89de802c79ecc5c2660d Reviewed-on: https://go-review.googlesource.com/c/go/+/227639 Run-TryBot: Andrew Bonventre <andybons@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-04-07[release-branch.go1.13] runtime: fix rounding in materializeGCProgAustin Clements
materializeGCProg allocates a temporary buffer for unrolling a GC program. Unfortunately, when computing the size of the buffer, it rounds *down* the number of bytes needed to store bitmap before rounding up the number of pages needed to store those bytes. The fact that it rounds up to pages usually mitigates the rounding down, but the type from #37470 exists right on the boundary where this doesn't work: type Sequencer struct { htable [1 << 17]uint32 buf []byte } On 64-bit, this GC bitmap is exactly 8 KiB of zeros, followed by three one bits. Hence, this needs 8193 bytes of storage, but the current math in materializeGCProg rounds *down* the three one bits to 8192 bytes. Since this is exactly pageSize, the next step of rounding up to the page size doesn't mitigate this error, and materializeGCProg allocates a buffer that is one byte too small. runGCProg then writes one byte past the end of this buffer, causing either a segfault (if you're lucky!) or memory corruption. Updates #37470. Fixes #37483. Change-Id: Iad24c463c501cd9b1dc1924bc2ad007991a094a0 Reviewed-on: https://go-review.googlesource.com/c/go/+/224418 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-04-07[release-branch.go1.13] cmd/go: make module zip extraction more robustJay Conrod
Currently, we extract module zip files to temporary directories, then atomically rename them into place. On Windows, this can fail with ERROR_ACCESS_DENIED if another process (antivirus) has files open before the rename. In CL 220978, we repeated the rename operation in a loop over 500 ms, but this didn't solve the problem for everyone. A better solution will extract module zip files to their permanent locations in the cache and will keep a ".partial" marker file, indicating when a module hasn't been fully extracted (CL 221157). This approach is not safe if current versions of Go access the module cache concurrently, since the module directory is detected with a single os.Stat. In the interim, this CL makes two changes: 1. Flaky file system operations are repeated over 2000 ms to reduce the chance of this error occurring. 2. cmd/go will now check for .partial files created by future versions. If a .partial file is found, it will lock the lock file, then remove the .partial file and directory if needed. After some time has passed and Go versions lacking this CL are no longer supported, we can start extracting module zip files in place. Updates #37802 Change-Id: I467ee11aa59a90b63cf0e3e761c4fec89d57d3b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/221820 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry picked from commit 093049b3709eda7537ece92a2991918cf53782d6) Reviewed-on: https://go-review.googlesource.com/c/go/+/223146
2020-04-03[release-branch.go1.13] runtime: fix wrong offset when calling ppc64x ↵Carlos Eduardo Seo
nanotime syscall There is a wrong offset when getting the results of a clock_gettime syscall. Although the syscall will never be called in native ppc64x, QEMU doesn't implement VDSO, so it will return wrong values. For #36592 Fixes #38236 Change-Id: Icf838075228dcdd62cf2c1279aa983e5993d66ee Reviewed-on: https://go-review.googlesource.com/c/go/+/215397 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> (cherry picked from commit 71239b4f491698397149868c88d2c851de2cd49b) Reviewed-on: https://go-review.googlesource.com/c/go/+/227179 Reviewed-by: Carlos Eduardo Seo <cseo@linux.vnet.ibm.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-03-31[release-branch.go1.13] cmd/go: fix and skip known Windows test failuresDmitri Shuralyov
These non-short Windows test failures were resolved fully in CL 206144. Both TestScript/build_trimpath and TestScript/version tests can be fixed by backporting the changes to test scripts only, so that is done here. Fixing TestScript/mod_list_dir requires backporting non-test changes in addition to the test script changes, which is unlikely to be appropriate this late in Go 1.13 release cycle. A failing test can cover up other regressions, so skip this known failing test to fix the builder. For #36181. Change-Id: I4f140bd373554eb4664f04638666dee77986ec3e Reviewed-on: https://go-review.googlesource.com/c/go/+/223782 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-03-31[release-branch.go1.13] cmd/doc: skip failing TestDotSlashLookup on WindowsDmitri Shuralyov
This test was fixed by changing cmd/doc behavior in CL 204442. Backporting that non-test code change is unlikely to be appropriate this late in Go 1.13 release cycle. A failing test can cover up other regressions, so skip this known failing test to fix the builder. For #35236. For #36181. Change-Id: I07e795e75d7e37bc96ab68607d5d5cc9254342f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/223780 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org>
2020-03-31[release-branch.go1.13] cmd/compile/internal/syntax: don't hardwire path ↵Robert Griesemer
separator in test Windows uses '\' not '/'. For #35175. Fixes #37901. Change-Id: Ib3d01dcf148fc0675496d5213f5bcc9cf210a6fc Reviewed-on: https://go-review.googlesource.com/c/go/+/203889 Reviewed-by: Bryan C. Mills <bcmills@google.com> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit a754d2993db1771ca3903d0a5d0e3add1883cf9b) Reviewed-on: https://go-review.googlesource.com/c/go/+/223703 Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Andrew Bonventre <andybons@golang.org>
2020-03-31[release-branch.go1.13] os: use an actual RemoveAll failure in ↵Bryan C. Mills
TestRemoveAllWithMoreErrorThanReqSize Previously we injected an error, and the injection points were (empirically) not realistic on some platforms. Instead, we now make the directory read-only, which (on most platforms) suffices to prevent the removal of its files. Also remove unused test hook, as was done in CL 204060. For #35117. For #29921. Fixes #37895. Change-Id: Ica4e2818566f8c14df3eed7c3b8de5c0abeb6963 Reviewed-on: https://go-review.googlesource.com/c/go/+/203502 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 06bdd52f7540eca9e3ade6e78234d00703f3ee23) Reviewed-on: https://go-review.googlesource.com/c/go/+/223700 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-03-31[release-branch.go1.13] net/http: deflake ↵Constantin Konstantinidis
TestCancelRequestWithChannelBeforeDo_Cancel Goroutines clean up takes longer when using deprecated CloseNotifier. For #35122. Fixes #37892. Change-Id: Id820a3012b5c781ddfb294b38ee3b009624e398c Reviewed-on: https://go-review.googlesource.com/c/go/+/204661 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit 1e4a358454987ef5104e45081c8e2ecdc9f32513) Reviewed-on: https://go-review.googlesource.com/c/go/+/223699 Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-03-29[release-branch.go1.13] os/exec: use environment variables for user token ↵Liam 'Auzzie' Haworth
when present Builds upon the changes from #32000 which supported sourcing environment variables for a new process from the environment of a Windows user token when supplied. But due to the logic of os/exec, the Env field of a process was always non-nil when it reached that change. This change moves the logic up to os/exec, specifically when os.ProcAttr is being built for the os.StartProcess call, this ensures that if a user token has been supplied and no Env slice has been provided on the command it will be sourced from the user's environment. If no token is provided, or the program is compiled for any other platform than Windows, the default environment will be sourced from syscall.Environ(). For #35314 Fixes #37433 Change-Id: I4c1722e90b91945eb6980d5c5928183269b50487 GitHub-Last-Rev: 32216b7291418f9285147a93ed6d0ba028f94ef2 GitHub-Pull-Request: golang/go#37402 Reviewed-on: https://go-review.googlesource.com/c/go/+/220587 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/226280
2020-03-26[release-branch.go1.13] cmd/go: do not append to the global cfg.OrigEnv sliceBryan C. Mills
Appending to a global slice is only safe if its length is already equal to its capacity. That property is not guaranteed for slices in general, and empirically does not hold for this one. This is a minimal fix to make it easier to backport. A more robust cleanup of the base.EnvForDir function will be sent in a subsequent CL. Fixes #38082 Updates #38077 Change-Id: I731d5bbd0e516642c2cf43e713eeea15402604e5 Reviewed-on: https://go-review.googlesource.com/c/go/+/225577 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> (cherry picked from commit bfb1342a40216cba0ff5ae3a1b102823b7603068) Reviewed-on: https://go-review.googlesource.com/c/go/+/225660
2020-03-25[release-branch.go1.13] runtime: ignore error returned by ↵Alex Brainman
PowerRegisterSuspendResumeNotification It appears that PowerRegisterSuspendResumeNotification is not supported when running inside Docker - see issues #35447, #36557 and #37149. Our current code relies on error number to determine Docker environment. But we already saw PowerRegisterSuspendResumeNotification return ERROR_FILE_NOT_FOUND, ERROR_INVALID_PARAMETERS and ERROR_ACCESS_DENIED (see issues above). So this approach is not sustainable. Just ignore PowerRegisterSuspendResumeNotification returned error. For #37149 Fixes #37230 Change-Id: I2beba9d45cdb8c1efac5e974e747827a6261915a Reviewed-on: https://go-review.googlesource.com/c/go/+/219657 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> Reviewed-by: Jason A. Donenfeld <Jason@zx2c4.com> (cherry picked from commit d467f3bbc9c76805ae16ab1924c28ec3be487875) Reviewed-on: https://go-review.googlesource.com/c/go/+/224585 Run-TryBot: Ian Lance Taylor <iant@golang.org>
2020-03-19[release-branch.go1.13] go1.13.9go1.13.9Carlos Amedee
Change-Id: Ia0ad75ee0458df95f1e4e36cd440f4cb314c67cb Reviewed-on: https://go-review.googlesource.com/c/go/+/223940 Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-03-12[release-branch.go1.13] internal/syscall/windows/registry: remove ↵Jason A. Donenfeld
TestWalkFullRegistry due to false assumptions This test's existence was predicated upon assumptions about the full range of known data types and known data into those types. However, we've learned from Microsoft that there are several undocumented secret registry types that are in use by various parts of Windows, and we've learned from inspection that many Microsoft uses of registry types don't strictly adhere to the recommended value size. It's therefore foolhardy to make any assumptions about what goes in and out of the registry, and so this test, as well as its "blacklist", are meaningless. For #35084. Fixes #37826. Change-Id: I6c3fe5fb0e740e88858321b3b042c0ff1a23284e Reviewed-on: https://go-review.googlesource.com/c/go/+/203604 Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> (cherry picked from commit 0d3092ffa7e7f613429ddcfd596d26ccbc84766f) Reviewed-on: https://go-review.googlesource.com/c/go/+/223237 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-03-12[release-branch.go1.13] cmd/go: include the go language version in cache keysBryan C. Mills
Fixes #37821 Updates #37804 Change-Id: I4381dc5c58cfd467506d3d73fbd19c2c7257338e Reviewed-on: https://go-review.googlesource.com/c/go/+/223139 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> (cherry picked from commit c95708462fb24f379f4bcdedd6ea664ee38ea562) Reviewed-on: https://go-review.googlesource.com/c/go/+/223142 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-03-02[release-branch.go1.13] cmd/trace: update to use WebComponents V0 polyfillHana (Hyang-Ah) Kim
Old trace viewer stopped working with Chrome M80+ because the old trace viewer heavily depended on WebComponents V0 which are deprecated. Trace viewer recently migrated to use WebComponents V0 polyfill (crbug.com/1036492). This CL brings in the newly updated trace_viewer_full.html (sync'd @ 9508452e) and updates the javascript snippet included in the /trace endpoint to use the polyfill. This brings in webcomponents.min.js copied from https://chromium.googlesource.com/catapult/+/9508452e18f130c98499cb4c4f1e1efaedee8962/third_party/polymer/components/webcomponentsjs/webcomponents.min.js That is necessary because the /trace endpoint needs to import the vulcanized trace_viewer_full.html. It's possible that some features are not working correctly with this polyfill. In that case, report the issue to crbug.com/1036492. There will be a warning message in the UI (yellow banner above the timeline) which can be hidden by clicking the 'hide' button. This allows to render the trace in browsers other than chrome in theory, but I observed some buttons and functions still don't work outside chrome. Updates #34374. Fixes #37342. Change-Id: Ib575f756f5e6b22ad904ede6e4d224a995ebe259 Reviewed-on: https://go-review.googlesource.com/c/go/+/219997 Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com> (cherry picked from commit 75ea964b3f6073076e1a86a0de2be9a2f159da24) Reviewed-on: https://go-review.googlesource.com/c/go/+/220321 Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2020-02-26[release-branch.go1.13] cmd/go: fix cgo test when min macOS version is setJay Conrod
Regression tests for #24161 use a macro to conditionally compile some stub definitions. The macro tests that the minimum macOS version is less than 10.12. We get duplicate definitions when building this test with CGO_CFLAGS=-mmacosx-version-min=10.x where 10.x < 10.12. With this change, we use a different macro, __MAC_OS_X_VERSION_MAX_ALLOWED__, which tests the SDK version instead of the minimum macOS version. This checks whether these definitions are present in headers. After this change, 'go tool dist test cgo_test' should pass with CGO_FLAGS=-mmacosx-version-min=10.10. Updates #36846 Updates #35459 Change-Id: I88d63601c94b0369c73c38d216a2d41ba7d4e579 Reviewed-on: https://go-review.googlesource.com/c/go/+/216243 Run-TryBot: Jay Conrod <jayconrod@google.com> Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> (cherry picked from commit 1f9f88b95eaec50c72c8595ca9f52b7b876e28f9) Reviewed-on: https://go-review.googlesource.com/c/go/+/217059 Run-TryBot: Carlos Amedee <carlos@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-02-26[release-branch.go1.13] cmd/go: add -d flag to mod_get_testJay Conrod
'go get all' was run in this test without -d. This caused some std packages to be reinstalled if the test is run in a slightly different configuration than make.bash was run. run.bash would fail in some situations because of this. Nothing in the cmd/go tests should modify installed std or cmd packages. Updates #36846 Updates #35459 Change-Id: Idd259a27d55502923b7fc54f361a77f0ac11eea2 Reviewed-on: https://go-review.googlesource.com/c/go/+/215721 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Michael Matloob <matloob@golang.org> (cherry picked from commit 71bbffbc48d03b447c73da1f54ac57350fc9b36a) Reviewed-on: https://go-review.googlesource.com/c/go/+/218597 Run-TryBot: Carlos Amedee <carlos@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
2020-02-26[release-branch.go1.13] cmd/link: ensure cgo cflags do not leak into dwarf testsCarlos Amedee
Running the dwarf tests with CGO_CFLAGS set with certain values would cause the test to fail. all.bash would fail when CGO_CFLAGS was set to '-mmacosx-version-min=10.10' because the --macosx-version-min flag is incompatible with some dwarf tests. The change guards against using an unintended flag in the unit test. Updates #36846 Updates #35459 Change-Id: Idc9b354aba44fdab424cb0081a4b3ea7a6d0f8e3 Reviewed-on: https://go-review.googlesource.com/c/go/+/216177 Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit e948d2b73ede67f12bff9e4d050f0e1425163010) Reviewed-on: https://go-review.googlesource.com/c/go/+/217057
2020-02-26[release-branch.go1.13] cmd/link: ensure cgo cflags do not leak into tvOS testCarlos Amedee
Running the 'TestBuildForTvOS' test with CGO_CFLAGS set with certain values would cause the test to fail. all.bash would fail when CGO_CFLAGS was set to '-mmacosx-version-min=10.10' because the --macosx-version-min flag is incompatible with tvOS. The change guards against using an unintended flag in the unit test. Updates #36846 Updated #35459 Change-Id: Ifc43f3ebfb23d37aabeaac2ea9efae5b877991bf Reviewed-on: https://go-review.googlesource.com/c/go/+/215957 Run-TryBot: Carlos Amedee <carlos@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit ace25f82df0a27eb26a518e1883eb56c1bec6c5e) Reviewed-on: https://go-review.googlesource.com/c/go/+/218598
2020-02-26[release-branch.go1.13] crypto/cipher: require non-zero nonce size for AES-GCMKatie Hockman
Also fix typo in crypto/cipher/gcm_test.go. Updates #37118 Fixes #37417 Change-Id: I8544d1eeeb1f0336cebb977b8c5bfa5e4c5ad8c7 Reviewed-on: https://go-review.googlesource.com/c/go/+/218500 Run-TryBot: Katie Hockman <katie@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> (cherry picked from commit 4e8badbbc2fe7854bb1c12a9ee42315b4d535051) Reviewed-on: https://go-review.googlesource.com/c/go/+/220653 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-02-12[release-branch.go1.13] go1.13.8go1.13.8Alexander Rakoczy
Change-Id: Ia174ccd8d5c26f44aeea188113e292f5048ec873 Reviewed-on: https://go-review.googlesource.com/c/go/+/219219 Run-TryBot: Alexander Rakoczy <alex@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Carlos Amedee <carlos@golang.org>
2020-02-11[release-branch.go1.13] net/http: only decrement connection count if we ↵Michael Fraenkel
removed a connection The connection count must only be decremented if the persistent connection was also removed. Fixes #36583 Change-Id: I5070717d5d9effec78016005fa4910593500c8cf Reviewed-on: https://go-review.googlesource.com/c/go/+/202087 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/215177 Run-TryBot: Alexander Rakoczy <alex@golang.org> Reviewed-by: Alexander Rakoczy <alex@golang.org>
2020-02-05[release-branch.go1.13] crypto/x509: fix godoc for MarshalPKCS8PrivateKeyKatie Hockman
Updates #36735 Fixes #37067 Change-Id: I93f005d78f4bfac773272995b165172461bae92f Reviewed-on: https://go-review.googlesource.com/c/go/+/217917 Run-TryBot: Katie Hockman <katie@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org> (cherry picked from commit 7a36fa400286ca51192a7661a7ffbf9a39c396b3) Reviewed-on: https://go-review.googlesource.com/c/go/+/217998
2020-01-28[release-branch.go1.13] all: merge release-branch.go1.13-security into ↵Dmitri Shuralyov
release-branch.go1.13 Change-Id: I7119985b7b6fc02010a623ba2bc6d0d647ea8f70
2020-01-27[release-branch.go1.13-security] go1.13.7go1.13.7Dmitri Shuralyov
Change-Id: I4e9b0a8eee1ea6a0854eab88a2daf77b21da549a Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/649300 Reviewed-by: Katie Hockman <katiehockman@google.com>