aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-08-29[release-branch.go1.18] cmd/compile: handle partially overlapping assignmentsKeith Randall
Normally, when moving Go values of type T from one location to another, we don't need to worry about partial overlaps. The two Ts must either be in disjoint (nonoverlapping) memory or in exactly the same location. There are 2 cases where this isn't true: 1) Using unsafe you can arrange partial overlaps. 2) Since Go 1.17, you can use a cast from a slice to a ptr-to-array. https://go.dev/ref/spec#Conversions_from_slice_to_array_pointer This feature can be used to construct partial overlaps of array types. var a [3]int p := (*[2]int)(a[:]) q := (*[2]int)(a[1:]) *p = *q We don't care about solving 1. Or at least, we haven't historically and no one has complained. For 2, we need to ensure that if there might be partial overlap, then we can't use OpMove; we must use memmove instead. (memmove handles partial overlap by copying in the correct direction. OpMove does not.) Note that we have to be careful here not to introduce a call when we're marshaling arguments to a call or unmarshaling results from a call. Fixes #54603 Change-Id: I1ca6aba8041576849c1d85f1fa33ae61b80a373d Reviewed-on: https://go-review.googlesource.com/c/go/+/425076 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Keith Randall <khr@golang.org> (cherry picked from commit 332a5981d0ae3f21f668f94755f43ecd8ee9a9eb) Reviewed-on: https://go-review.googlesource.com/c/go/+/425198
2022-08-29[release-branch.go1.18] cmd/link: fix trampolines breaking DWARF line infoJeremy Quirke
When trampolines are needed (e.g. Darwin ARM64), the DWARF LPT (Line Program Table - see DWARF section 6.1) generation fails because the replacement symbols are marked as external symbols and skipped during the DWARF LPT generation phase. Fixes #54502 Change-Id: I6c93f5378f50e5edf30d5121402a48214abb1ce2 GitHub-Last-Rev: 085bbc55dbc95d55456cc2acc46a0d02416c2848 GitHub-Pull-Request: golang/go#54321 Reviewed-on: https://go-review.googlesource.com/c/go/+/422154 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Than McIntosh <thanm@google.com> Reviewed-by: Than McIntosh <thanm@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 2340d371796f95acdcc399e60f9ecefec2add8df) Reviewed-on: https://go-review.googlesource.com/c/go/+/424536 Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-08-29[release-branch.go1.18] misc/cgo/testcarchive: permit SIGQUIT for ↵Ian Lance Taylor
TestSignalForwardingExternal Occasionally the signal will be sent to a Go thread, which will cause the program to exit with SIGQUIT rather than SIGSEGV. Add TestSignalForwardingGo to test the case where the signal is expected to be delivered to a Go thread. This is a roll forward of CL 419014 which was rolled back in CL 424954. This CL differs from 419014 in that it skips TestSignalForwardingGo on darwin-amd64. For #53907 Fixes #54056 Change-Id: I5df3fd610c068df3bd48d9b3d7a9379248b97999 Reviewed-on: https://go-review.googlesource.com/c/go/+/425002 Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> (cherry picked from commit d05ce23756573c6dc2c5026d936f2ef6ac140ee2) Reviewed-on: https://go-review.googlesource.com/c/go/+/425486 Reviewed-by: David Chase <drchase@google.com>
2022-08-26[release-branch.go1.18] net: fix WriteMsgUDPAddrPort addr handlingdatabase64128
WriteMsgUDPAddrPort should accept IPv4 target addresses on IPv6 UDP sockets. An IPv4 target address will be converted to an IPv4-mapped IPv6 address. Include the change in CL 420775 to also skip the test on DragonflyBSD. Updates #52264. Fixes #54074. Change-Id: Ib9ed4c61fa1289ae7bbc8c4c9de1a9951b647ec0 GitHub-Last-Rev: 6776fdb0a76faa71ebde58f5143fb1ffb3112adf GitHub-Pull-Request: golang/go#52265 Reviewed-on: https://go-review.googlesource.com/c/go/+/399454 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/425488 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-19[release-branch.go1.18] all: upgrade github.com/google/pprof to ↵Michael Pratt
v0.0.0-20220729232143-a41b82acbcb1 Update the vendored copy of github.com/google/pprof to include the fix for #54105. pprof's go.mod specifies an upgrade to x/sys, thus we must also update std's x/sys to match this version. For #54105. Fixes #54464. Change-Id: I0ca4f338b3ec3e8c54a892eb684a5dd3af8d7f1b Reviewed-on: https://go-review.googlesource.com/c/go/+/423576 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Michael Pratt <mpratt@google.com>
2022-08-08[release-branch.go1.18] cmd/compile: fix boolean comparison on RISCV64Cherry Mui
Following CL 421457, for RISCV64. May fix RISCV64 builds. Updates #52788. Updates #53397. Change-Id: Ifc34658703d1e8b97665e7b862060152e3005d71 Reviewed-on: https://go-review.googlesource.com/c/go/+/405553 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/421460 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
2022-08-08[release-branch.go1.18] cmd/compile: fix boolean comparison on PPC64Cherry Mui
Following CL 421457, for PPC64. Should fix PPC64 builds. Updates #52788. Updates #53397. Change-Id: I193ac31cfba18b4f907dd2523b51368251fd6fad Reviewed-on: https://go-review.googlesource.com/c/go/+/405116 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/421459 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-08[release-branch.go1.18] cmd/compile: more fix on boolean ops on ARM64Cherry Mui
Following CL 421457, the extension rule is also wrong. It is safe to drop the extension if the value is from a boolean-generating instruction, but not a boolean-typed Value in general (e.g. a Phi or a in-register parameter). Fix it. Updates #52788. Updates #53397. Change-Id: Icf3028fe8e90806f9f57fbe2b38d47da27a97e2a Reviewed-on: https://go-review.googlesource.com/c/go/+/405115 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/421458 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-08[release-branch.go1.18] cmd/compile: fix If lowering on ARM64Cherry Mui
On ARM64, an If block is lowered to (NZ cond yes no). This is incorrect because cond is a boolean value and therefore only the last byte is meaningful (same as AMD64, see ARM64Ops.go). But here we are comparing a full register width with 0. Correct it by comparing only the last bit. For #52788. Fixes #53397. Change-Id: I2cacf9f3d2f45e149c361a290f511b2d4ed845c4 Reviewed-on: https://go-review.googlesource.com/c/go/+/405114 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/421457 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org>
2022-08-03[release-branch.go1.18] encoding/xml: skip TestCVE202230633 for short testsRoland Shoemaker
TestCVE202230633 uses a bunch of memory, and the input cannot be feasibly reduced while maintaining the behavior hasn't regressed. This test could be reasonably removed, but I'd rather keep it around if we can. Updates #53814. Fixes #54128. Change-Id: Ie8b3f306efd20b2d9c0fb73122c26351a55694c4 Reviewed-on: https://go-review.googlesource.com/c/go/+/417655 Run-TryBot: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> (cherry picked from commit 783ff7dfc49d207114bb80e565e50ea6ff079326) Reviewed-on: https://go-review.googlesource.com/c/go/+/421094 Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-08-01[release-branch.go1.18] go1.18.5go1.18.5Gopher Robot
Change-Id: I4ca2e873fa21fb4676bc1d0e382bd8fd407a2986 Reviewed-on: https://go-review.googlesource.com/c/go/+/420555 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Gopher Robot <gobot@golang.org> Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-29[release-branch.go1.18] math/big: check buffer lengths in GobDecodeRoland Shoemaker
In Float.GobDecode and Rat.GobDecode, check buffer sizes before indexing slices. Updates #53871 Fixes #54095 Change-Id: I1b652c32c2bc7a0e8aa7620f7be9b2740c568b0a Reviewed-on: https://go-review.googlesource.com/c/go/+/417774 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Tatiana Bradley <tatiana@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org> (cherry picked from commit 055113ef364337607e3e72ed7d48df67fde6fc66) Reviewed-on: https://go-review.googlesource.com/c/go/+/419815 Reviewed-by: Julie Qiu <julieqiu@google.com>
2022-07-27[release-branch.go1.18] cmd/go: avoid re-enqueuing workspace dependencies ↵Bryan C. Mills
with errors Fixes #53875. Updates #53874. Change-Id: I41ab15cb9b86b807a9d9ad21fe21fb7aa5fbb46f Reviewed-on: https://go-review.googlesource.com/c/go/+/417594 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit a906d3dd099424ff17d7e46c4ecf793012d50197) Reviewed-on: https://go-review.googlesource.com/c/go/+/417656
2022-07-27[release-branch.go1.18] cmd/compile: revert "fix missing dict pass for type ↵Matthew Dempsky
assertions" This reverts CL 411934 (commit 460a93b54af4a0305f6007e44e41e6160a6469d8). Fixes #53852. Updates #53357. Change-Id: I93d7015d8962d22ffd73128b038e4e7e7ca41c2f Reviewed-on: https://go-review.googlesource.com/c/go/+/417615 Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-27[release-branch.go1.18] cmd/compile: revert "backport fix for #51840"Matthew Dempsky
This reverts CL 405436 (commit e1b14f53c13c7ab809ea1a33d2ec7f787efdafa8). Fixes #53883. Updates #51840. Change-Id: Ide5a9568a7ae5b449ef154c29b69699a7e4b3f6b Reviewed-on: https://go-review.googlesource.com/c/go/+/417616 Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Jenny Rakoczy <jenny@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-26[release-branch.go1.18] cmd/compile: do not use special literal assignment ↵Cherry Mui
if LHS is address-taken A composite literal assignment x = T{field: v} may be compiled to x = T{} x.field = v We already do not use this form is RHS uses LHS. If LHS is address-taken, RHS may uses LHS implicitly, e.g. v = &x.field x = T{field: *v} The lowering above would change the value of RHS (*v). Updates #52953. Fixes #52961. Change-Id: I3f798e00598aaa550b8c17182c7472fef440d483 Reviewed-on: https://go-review.googlesource.com/c/go/+/407014 Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com> (cherry picked from commit 1c77137d4fdfbb3e7e8d9efaab3bab5ee736a19d) Reviewed-on: https://go-review.googlesource.com/c/go/+/419450 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2022-07-25[release-branch.go1.18] testing: include ERROR_SHARING_VIOLATION in Windows ↵Bryan C. Mills
cleanup retries Fixes #52986 Updates #51442 Updates #50051 Change-Id: I1bfbc08c907077467fd50febbec6299a9b73af41 Reviewed-on: https://go-review.googlesource.com/c/go/+/388916 Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> (cherry picked from commit eeb9f095dc13a6beed41db0e734b6ae1e97f15d1) Reviewed-on: https://go-review.googlesource.com/c/go/+/407877 Reviewed-by: Nooras Saba‎ <saba@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com>
2022-07-25[release-branch.go1.18] cmd/go: omit build metadata that may contain system ↵Bryan C. Mills
paths when -trimpath is set CGO flag variables often include system paths for header files and compiled libraries. The point of -trimpath is to avoid dependending on system paths, so stamping these variables is counterproductive. Moreover, the point of stamping build information is to improve reproducibility. Since we don't also stamp the versions of C compilers, headers, and libraries used in a cgo build, only the most trivial cgo programs can be faithfully reproduced from the stamped information. Likewise, the -ldflags flag may include system-specific paths, particularly if external linking is in use. For now, we omit -ldflags entirely; however, in the future we may instead want to parse and redact the individual flags. Updates #52372. Fixes #53119. Change-Id: I73318a01cce4371d66955b3261fc7ee58d4b33dd Reviewed-on: https://go-review.googlesource.com/c/go/+/409174 TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> (cherry picked from commit a6e5be0d30770e8bd1ba1e4bac2089218df121d9) Reviewed-on: https://go-review.googlesource.com/c/go/+/414794 Reviewed-by: Nooras Saba‎ <saba@golang.org>
2022-07-25[release-branch.go1.18] runtime: clear timerModifiedEarliest when last timer ↵Michael Pratt
is deleted timerModifiedEarliest contains the lowest possible expiration for a modified earlier timer, which may be earlier than timer0When because we haven't yet updated the heap. Note "may", as the modified earlier timer that set timerModifiedEarliest may have since been modified later or deleted. We can clear timerModifiedEarliest when the last timer is deleted because by definition there must not be any modified earlier timers. Why does this matter? checkTimersNoP claims that there is work to do if timerModifiedEarliest has passed, causing findRunnable to loop back around to checkTimers. But the code to clean up timerModifiedEarliest in checkTimers (i.e., the call to adjusttimers) is conditional behind a check that len(pp.timers) > 0. Without clearing timerModifiedEarliest, a spinning M that would otherwise go to sleep will busy loop in findRunnable until some other work is available. Note that changing the condition on the call to adjusttimers would also be a valid fix. I took this approach because it feels a bit cleaner to clean up timerModifiedEarliest as soon as it is known to be irrelevant. For #51654. Fixes #53847. Change-Id: I3f3787c67781cac7ce87939c5706cef8db927dd5 Reviewed-on: https://go-review.googlesource.com/c/go/+/417434 Auto-Submit: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Pratt <mpratt@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> (cherry picked from commit c006b7ac2765252f397dec40fef610a3c17d956d) Reviewed-on: https://go-review.googlesource.com/c/go/+/417475
2022-07-22[release-branch.go1.18] runtime: use saved LR when unwinding through morestackCherry Mui
On LR machine, consider F calling G calling H, which grows stack. The stack looks like ... G's frame: ... locals ... saved LR = return PC in F <- SP points here at morestack H's frame (to be created) At morestack, we save gp.sched.pc = H's morestack call gp.sched.sp = H's entry SP (the arrow above) gp.sched.lr = return PC in G Currently, when unwinding through morestack (if _TraceJumpStack is set), we switch PC and SP but not LR. We then have frame.pc = H's morestack call frame.sp = H's entry SP (the arrow above) As LR is not set, we load it from stack at *sp, so frame.lr = return PC in F As the SP hasn't decremented at the morestack call, frame.fp = frame.sp = H's entry SP Unwinding a frame, we have frame.pc = old frame.lr = return PC in F frame.sp = old frame.fp = H's entry SP a.k.a. G's SP The PC and SP don't match. The unwinding will go off if F and G have different frame sizes. Fix this by preserving the LR when switching stack. Also add code to detect infinite loop in unwinding. TODO: add some test. I can reproduce the infinite loop (or throw with added check) but the frequency is low. Fixes #53112. Updates #52116. Change-Id: I6e1294f1c6e55f664c962767a1cf6c466a0c0eff Reviewed-on: https://go-review.googlesource.com/c/go/+/400575 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Cherry Mui <cherryyz@google.com> Reviewed-by: Eric Fang <eric.fang@arm.com> Reviewed-by: Benny Siegert <bsiegert@gmail.com> (cherry picked from commit 74f00094220f26c80fbaab6eca28c3a664897d24) Reviewed-on: https://go-review.googlesource.com/c/go/+/408821 Reviewed-by: Austin Clements <austin@google.com>
2022-07-12[release-branch.go1.18] go1.18.4go1.18.4Gopher Robot
Change-Id: I9f64c24e60775e23095bf144fecad32e13fbd9d7 Reviewed-on: https://go-review.googlesource.com/c/go/+/417177 Run-TryBot: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Gopher Robot <gobot@golang.org> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-07-12[release-branch.go1.18] encoding/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 #53710 Updates #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> (cherry picked from commit 55e8f938d22bfec29cc9dc9671044c5a41d1ea9c) Reviewed-on: https://go-review.googlesource.com/c/go/+/417060 Reviewed-by: Tatiana Bradley <tatiana@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-07-12[release-branch.go1.18] path/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 #53714 Updates #53416 Fixes CVE-2022-30632 Change-Id: I1b9fd4faa85411a05dbc91dceae1c0c8eb021f07 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1498176 Reviewed-by: Roland Shoemaker <bracewell@google.com> (cherry picked from commit d182a6d1217fd0d04c9babfa9a7ccd3515435c39) Reviewed-on: https://go-review.googlesource.com/c/go/+/417059 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com>
2022-07-12[release-branch.go1.18] io/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 #53720 Updates #53415 Fixes CVE-2022-30630 Change-Id: I5a9d02591fed90cd3d52627f5945f1301e53465d Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1497588 Reviewed-by: Roland Shoemaker <bracewell@google.com> (cherry picked from commit fdccc5d7bd0f276d0a8de3a818ca844f0bed5d97) Reviewed-on: https://go-review.googlesource.com/c/go/+/417058 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-07-12[release-branch.go1.18] compress/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 #53718 Updates #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> (cherry picked from commit cf498969c8a0bae9d7a24b98fc1f66c824a4775d) Reviewed-on: https://go-review.googlesource.com/c/go/+/417057 Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-07-12[release-branch.go1.18] go/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 #53708 Updates #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> (cherry picked from commit 6a856f08d58e4b6705c0c337d461c540c1235c83) Reviewed-on: https://go-review.googlesource.com/c/go/+/417056 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-07-12[release-branch.go1.18] encoding/xml: limit depth of nesting in unmarshalRoland Shoemaker
Prevent exhausting the stack limit when unmarshalling extremely deeply nested structures into nested types. Fixes #53716 Updates #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> (cherry picked from commit ebee00a55e28931b2cad0e76207a73712b000432) Reviewed-on: https://go-review.googlesource.com/c/go/+/417055 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com>
2022-07-12[release-branch.go1.18] encoding/xml: use iterative Skip, rather than recursiveRoland Shoemaker
Prevents exhausting the stack limit in _incredibly_ deeply nested structures. Fixes #53712 Updates #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> (cherry picked from commit 9278cb78443d2b4deb24cbb5b61c9ba5ac688d49) Reviewed-on: https://go-review.googlesource.com/c/go/+/417054 Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: Michael Knyszek <mknyszek@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
2022-07-12[release-branch.go1.18] net/http: preserve nil values in Header.CloneDamien Neil
ReverseProxy makes a distinction between nil and zero-length header values. Avoid losing nil-ness when cloning a request. Thanks to Christian Mehlmauer for discovering this. For #53423 For CVE-2022-32148 Fixes #53621 Change-Id: Ice369cdb4712e2d62e25bb881b080847aa4801f5 Reviewed-on: https://go-review.googlesource.com/c/go/+/412857 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit b2cc0fecc2ccd80e6d5d16542cc684f97b3a9c8a) Reviewed-on: https://go-review.googlesource.com/c/go/+/415222 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com> Run-TryBot: Heschi Kreinick <heschi@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com>
2022-07-12[release-branch.go1.18] net/http: don't strip whitespace from ↵Damien Neil
Transfer-Encoding headers Do not accept "Transfer-Encoding: \rchunked" as a valid TE header setting chunked encoding. Thanks to Zeyu Zhang (https://www.zeyu2001.com/) for identifying the issue. For #53188 For CVE-2022-1705 Fixes #53433 Change-Id: I1a16631425159267f2eca68056b057192a7edf6c Reviewed-on: https://go-review.googlesource.com/c/go/+/409874 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> (cherry picked from commit e5017a93fcde94f09836200bca55324af037ee5f) Reviewed-on: https://go-review.googlesource.com/c/go/+/415218 Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
2022-07-07[release-branch.go1.18] cmd/compile: only check implicit dots for method ↵Cuong Manh Le
call enabled by a type bound Fixes #53723 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> Reviewed-on: https://go-review.googlesource.com/c/go/+/416155 Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Heschi Kreinick <heschi@google.com>
2022-07-06[release-branch.go1.18] cmd/link: use TOC-relative trampolines on PPC64 when ↵Paul E. Murphy
needed When linking a PIE binary with the internal linker, TOC relative relocations need to be generated. Update trampolines to indirect call using R12 to more closely match the AIX/ELFv2 regardless of buildmode, and work with position-indepdent code. Likewise, update the check for offseting R_CALLPOWER relocs to make a local call. It should be checking ldr.AttrExternal, not ldr.IsExternal. This offset should not be adjusted for external (non-go) object files, it is handled when ELF reloc are translated into go relocs. And, update trampoline tests to verify these are generated correctly and produce a working binary using -buildmode=pie on ppc64le. Fixes #53107 Change-Id: I8a2dea06c3237bdf0e87888b56a17b6c4c99a7de Reviewed-on: https://go-review.googlesource.com/c/go/+/400234 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Paul Murphy <murp@ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/409075 Run-TryBot: Cherry Mui <cherryyz@google.com>
2022-07-06[release-branch.go1.18] cmd/link: preserve symbol attributes when cloning to ↵Cherry Mui
external There are some symbol attributes that are encoded in the object file. Currently, they are lost when cloning a symbol to external. Copy them over. Also delete CopyAttributes as it is no longer called anywhere. For #53107. Backporting this CL as the fix of #53107 depends on it. Change-Id: I1497e3223a641704bf35aa3e904dd0eda2f8ec3e Reviewed-on: https://go-review.googlesource.com/c/go/+/400574 Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> (cherry picked from commit df08c9a82152fd6f2b2811db03b40fea8b6e5e9e) Reviewed-on: https://go-review.googlesource.com/c/go/+/408820
2022-07-06[release-branch.go1.18] runtime: add race annotations to cbs.lockMichael Pratt
cbs.lock protects a map. The map implementation is race instrumented regardless of which package is it called from. lock/unlock are not automatically race instrumented, so we can trigger race false positives without manually annotating our lock acquire and release. compileCallback is used during initialization before the P is available, at which point raceacquire will crash during a racecallback to get the race proc. Thus we skip instrumentation until scheduler initialization is complete. Fixes #53613. For #50249. Change-Id: Ie49227c9e9210ffbf0aee65f86f2b7b6a2f64638 Reviewed-on: https://go-review.googlesource.com/c/go/+/414518 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Michael Pratt <mpratt@google.com> (cherry picked from commit 20760cff001e9acc05627dfeab42ea50b57920e6) Reviewed-on: https://go-review.googlesource.com/c/go/+/415198 Run-TryBot: Heschi Kreinick <heschi@google.com>
2022-07-06[release-branch.go1.18] cmd/compile: fix prove pass when upper condition is ↵Keith Randall
<= maxint When the terminating condition is <= X, we need to make sure that X+step doesn't overflow. Fixes #53618 Change-Id: I36e5384d05b4d7168e48db6094200fcae409bfe5 Reviewed-on: https://go-review.googlesource.com/c/go/+/415219 Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: David Chase <drchase@google.com> Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Keith Randall <khr@golang.org> (cherry picked from commit 31b8c23c5702f129aca9241bbb2132c90b1929cc) Reviewed-on: https://go-review.googlesource.com/c/go/+/415414 Reviewed-by: Keith Randall <khr@google.com>
2022-07-06[release-branch.go1.18] runtime: add race annotations to metricsSemaMichael Pratt
metricsSema protects the metrics map. The map implementation is race instrumented regardless of which package is it called from. semacquire/semrelease are not automatically race instrumented, so we can trigger race false positives without manually annotating our lock acquire and release. See similar instrumentation on trace.shutdownSema and reflectOffs.lock. Fixes #53590. For #53542. Change-Id: Ia3fd239ac860e037d09c7cb9c4ad267391e70705 Reviewed-on: https://go-review.googlesource.com/c/go/+/414517 Run-TryBot: Michael Pratt <mpratt@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> (cherry picked from commit d6481d5b9662b29453004204746945a93a6b4eb2) Reviewed-on: https://go-review.googlesource.com/c/go/+/415195
2022-07-06[release-branch.go1.18] cmd/go: pass --no-decorate when listing git tags for ↵hidu
a commit This avoids a parse error when the user's global .gitconfig sets log.decorate to true. Updates #51312. Fixes #53588. Change-Id: Ic47b0f604c0c3a404ec50d6e09f4e138045ac2f2 Reviewed-on: https://go-review.googlesource.com/c/go/+/387835 Run-TryBot: Bryan Mills <bcmills@google.com> Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> (cherry picked from commit a30f4346674ec43bf576e6f56a9cd1c7ca482e1f) Reviewed-on: https://go-review.googlesource.com/c/go/+/414874
2022-07-06[release-branch.go1.18] cmd/compile: fix generic inter-inter comparisons ↵Cuong Manh Le
from value switch statements If value is a non-empty interface and has shape, we still need to convert it to an interface{} first. Fixes #53587 Change-Id: I516063ba4429a6cc24c483758387ec13815fc63e Reviewed-on: https://go-review.googlesource.com/c/go/+/414834 Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-on: https://go-review.googlesource.com/c/go/+/414835
2022-07-06[release-branch.go1.18] cmd/compile: allow 128-bit values to be spilledKeith Randall
We sometimes use 16-byte load+store to move values around in memory. In rare circumstances, the loaded value must be spilled because the store can't happen yet. In that case, we need to be able to spill the 16-byte value. Fixes #53471 Change-Id: I09fd08e11a63c6ba3ef781d3f5ede237e9b0132e Reviewed-on: https://go-review.googlesource.com/c/go/+/413294 Reviewed-by: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com> (cherry picked from commit c2d373d5d1802d7479f3c81dcf01d41bef3646dd) Reviewed-on: https://go-review.googlesource.com/c/go/+/413455 Reviewed-by: Alex Rakoczy <jenny@golang.org>
2022-07-06[release-branch.go1.18] cmd/compile: fix missing dict pass for type assertionsCuong Manh Le
For type assertions, if either src or dst type has shape, we must convert them to dynamic type assertions. Fixes #53357 Change-Id: Ia3362fa67c011febcbdb5b26f856d081b5c366de Reviewed-on: https://go-review.googlesource.com/c/go/+/411617 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/411934 Reviewed-by: Keith Randall <khr@google.com>
2022-07-06[release-branch.go1.18] cmd/compile: fix wrong unsafe.Offsetof evaluation ↵Cuong Manh Le
inside generic function For instantiated generic functions, all implicit dot operations are resolved. Thus unsafe.Offsetof may calculating the offset against the wrong base selector. To fix it, we must remove any implicit dot operations to find the first non-implicit one, which is the right base selector for calculating the offset. Fixes #53159 Change-Id: I38504067ce0f274615b306edc8f7d7933bdb631a Reviewed-on: https://go-review.googlesource.com/c/go/+/409355 Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/409494
2022-07-06[release-branch.go1.18] runtime: store consistent total allocation stats as ↵Michael Anthony Knyszek
uint64 Currently the consistent total allocation stats are managed as uintptrs, which means they can easily overflow on 32-bit systems. Fix this by storing these stats as uint64s. This will cause some minor performance degradation on 32-bit systems, but there really isn't a way around this, and it affects the correctness of the metrics we export. For #52680. Fixes #52689. Change-Id: I8b1926116e899ae9f03d58e0320bcb9264945b3e Reviewed-on: https://go-review.googlesource.com/c/go/+/411495 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
2022-06-01[release-branch.go1.18] go1.18.3go1.18.3Dmitri Shuralyov
Change-Id: I89e0df420c0626add131103015cadd7b3f3dfd98 Reviewed-on: https://go-review.googlesource.com/c/go/+/409735 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@golang.org> Reviewed-by: Alex Rakoczy <alex@golang.org>
2022-05-31[release-branch.go1.18] path/filepath: do not remove prefix "." when ↵Yasuhiro Matsumoto
following path contains ":". For #52476 Fixes #52479 Fixes CVE-2022-29804 Change-Id: I9eb72ac7dbccd6322d060291f31831dc389eb9bb Reviewed-on: https://go-review.googlesource.com/c/go/+/401595 Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: Alex Brainman <alex.brainman@gmail.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-on: https://go-review.googlesource.com/c/go/+/405234 Reviewed-by: Yasuhiro Matsumoto <mattn.jp@gmail.com>
2022-05-30[release-branch.go1.18] misc/cgo/testsanitizers: buffer the signal channel ↵Bryan C. Mills
in TestTSAN/tsan11 This fix is analogous to the one in CL 407888. 'go vet' catches the error, but it is not run on this file because the file is (only) compiled when running testsanitizers/TestTSAN. Fixes #53115. Updates #53113. Change-Id: I74f7b7390a9775ff00a06214c1019ba28846dd11 Reviewed-on: https://go-review.googlesource.com/c/go/+/409094 Auto-Submit: Bryan Mills <bcmills@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Bryan Mills <bcmills@google.com> (cherry picked from commit 0f57c88bce9899a91686646a1e9cd7aae55911ef) Reviewed-on: https://go-review.googlesource.com/c/go/+/408823 Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-05-27[release-branch.go1.18] crypto/tls: avoid extra allocations in steady-state ↵David Taylor
Handshake calls The Read and Write methods of *tls.Conn call Handshake unconditionally, every time they are called, expecting it to only perform a new handshake if required. However in go 1.17 handshakeContext was extended to set up a cancelable Context, and importantly did so prior to checking if a handshake is required. This thus causes it to allocate on every call, even in those that are no-ops when called in a Read or Write on an established connection, sometimes leading to very large numbers of allocations during reads. This change adds an early return, prior to setting up the context or proceeding into the handshakeMutex and checking the handshake error, if the handshake status atomic indicates handshake is already complete. name old allocs/op new allocs/op delta Throughput/MaxPacket/1MB/TLSv12-10 1.07k ± 0% 0.62k ± 0% -42.16% (p=0.000 n=4+5) Throughput/MaxPacket/1MB/TLSv13-10 1.70k ± 0% 1.25k ± 0% ~ (p=0.079 n=4+5) Throughput/MaxPacket/2MB/TLSv12-10 1.62k ± 0% 0.73k ± 0% -55.18% (p=0.008 n=5+5) Throughput/MaxPacket/2MB/TLSv13-10 2.26k ± 0% 1.36k ± 0% -39.64% (p=0.008 n=5+5) Throughput/MaxPacket/4MB/TLSv12-10 2.74k ± 0% 0.95k ± 0% -65.35% (p=0.008 n=5+5) Throughput/MaxPacket/4MB/TLSv13-10 3.37k ± 0% 1.58k ± 0% -53.15% (p=0.008 n=5+5) Throughput/MaxPacket/8MB/TLSv12-10 4.96k ± 0% 1.39k ± 0% -72.06% (p=0.016 n=4+5) Throughput/MaxPacket/8MB/TLSv13-10 5.60k ± 0% 2.01k ± 0% -64.05% (p=0.008 n=5+5) Throughput/MaxPacket/16MB/TLSv12-10 9.42k ± 0% 2.27k ± 1% -75.92% (p=0.016 n=4+5) Throughput/MaxPacket/16MB/TLSv13-10 10.0k ± 0% 2.9k ± 0% -71.39% (p=0.008 n=5+5) Throughput/MaxPacket/32MB/TLSv12-10 18.3k ± 0% 4.0k ± 0% -77.97% (p=0.008 n=5+5) Throughput/MaxPacket/32MB/TLSv13-10 18.9k ± 0% 4.6k ± 0% -75.62% (p=0.008 n=5+5) Throughput/MaxPacket/64MB/TLSv12-10 36.2k ± 0% 7.5k ± 0% -79.15% (p=0.008 n=5+5) Throughput/MaxPacket/64MB/TLSv13-10 36.7k ± 0% 8.1k ± 0% -78.06% (p=0.008 n=5+5) Throughput/DynamicPacket/1MB/TLSv12-10 1.12k ± 0% 0.63k ± 0% -44.20% (p=0.008 n=5+5) Throughput/DynamicPacket/1MB/TLSv13-10 1.76k ± 0% 1.26k ± 0% -28.22% (p=0.016 n=5+4) Throughput/DynamicPacket/2MB/TLSv12-10 1.68k ± 0% 0.74k ± 0% -56.11% (p=0.008 n=5+5) Throughput/DynamicPacket/2MB/TLSv13-10 2.32k ± 0% 1.37k ± 0% -40.80% (p=0.008 n=5+5) Throughput/DynamicPacket/4MB/TLSv12-10 2.80k ± 0% 0.96k ± 0% -65.81% (p=0.008 n=5+5) Throughput/DynamicPacket/4MB/TLSv13-10 3.43k ± 0% 1.59k ± 0% -53.57% (p=0.008 n=5+5) Throughput/DynamicPacket/8MB/TLSv12-10 5.03k ± 0% 1.39k ± 0% -72.27% (p=0.008 n=5+5) Throughput/DynamicPacket/8MB/TLSv13-10 5.66k ± 0% 2.02k ± 0% -64.27% (p=0.008 n=5+5) Throughput/DynamicPacket/16MB/TLSv12-10 9.48k ± 0% 2.28k ± 1% -75.98% (p=0.008 n=5+5) Throughput/DynamicPacket/16MB/TLSv13-10 10.1k ± 0% 2.9k ± 0% -71.34% (p=0.008 n=5+5) Throughput/DynamicPacket/32MB/TLSv12-10 18.4k ± 0% 4.0k ± 0% -78.13% (p=0.008 n=5+5) Throughput/DynamicPacket/32MB/TLSv13-10 19.0k ± 0% 4.6k ± 0% -75.54% (p=0.008 n=5+5) Throughput/DynamicPacket/64MB/TLSv12-10 36.2k ± 0% 7.6k ± 1% -79.02% (p=0.008 n=5+5) Throughput/DynamicPacket/64MB/TLSv13-10 36.8k ± 0% 8.2k ± 1% -77.76% (p=0.008 n=5+5) Fixes #52791 Change-Id: Iacb1f9bf7802022960d9dbce141b8c0587a614d4 Reviewed-on: https://go-review.googlesource.com/c/go/+/379034 Reviewed-by: David Chase <drchase@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Filippo Valsorda <valsorda@google.com> Auto-Submit: Filippo Valsorda <filippo@golang.org> Run-TryBot: Filippo Valsorda <filippo@golang.org> (cherry picked from commit a4af35607536b2b0d73be94df188b9f5a157480c) Reviewed-on: https://go-review.googlesource.com/c/go/+/405545 Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Alex Rakoczy <alex@golang.org>
2022-05-27[release-branch.go1.18 crypto/tls: randomly generate ticket_age_addTatiana Bradley
As required by RFC 8446, section 4.6.1, ticket_age_add now holds a random 32-bit value. Before this change, this value was always set to 0. This change also documents the reasoning for always setting ticket_nonce to 0. The value ticket_nonce must be unique per connection, but we only ever send one ticket per connection. Updates #52814 Fixes #52833 Fixes CVE-2022-30629 Change-Id: I6c2fc6ca0376b7b968abd59d6d3d3854c1ab68bb Reviewed-on: https://go-review.googlesource.com/c/go/+/405994 Reviewed-by: Tatiana Bradley <tatiana@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Run-TryBot: Tatiana Bradley <tatiana@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit fe4de36198794c447fbd9d7cc2d7199a506c76a5) Reviewed-on: https://go-review.googlesource.com/c/go/+/408575 Run-TryBot: Roland Shoemaker <roland@golang.org>
2022-05-27[release-branch.go1.18] os/exec: return clear error for missing cmd.PathRuss Cox
Following up on CL 403694, there is a bit of confusion about when Path is and isn't set, along with now the exported Err field. Catch the case where Path and Err (and lookPathErr) are all unset and give a helpful error. Updates #52574 Followup after #43724. Fixes #53057 Fixes CVE-2022-30580 Change-Id: I03205172aef3801c3194f5098bdb93290c02b1b6 Reviewed-on: https://go-review.googlesource.com/c/go/+/403759 Reviewed-by: Bryan Mills <bcmills@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org> (cherry picked from commit 960ffa98ce73ef2c2060c84c7ac28d37a83f345e) Reviewed-on: https://go-review.googlesource.com/c/go/+/408577 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Roland Shoemaker <roland@golang.org>
2022-05-26[release-branch.go1.18] text/template/parse: allow space after continue or breakRob Pike
Trivial fix: We must skip space after either of these keywords before we expect a closing delimiter. Also delete the stutter-generating extra 'in' in the error message. (See what I did there?) For #51670 Fixes #52878 Change-Id: If5415632c36eaac6699bdc0aa6ce18be956c9b53 Reviewed-on: https://go-review.googlesource.com/c/go/+/392615 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Daniel Martí <mvdan@mvdan.cc> Trust: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gopher Robot <gobot@golang.org> (cherry picked from commit 41a82aa9c36bffab2593d50aa55a462fef4e5bd4) Reviewed-on: https://go-review.googlesource.com/c/go/+/406074 Reviewed-by: Alex Rakoczy <alex@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-05-25[release-branch.go1.18] cmd/compile: backport fix for #51840Matthew Dempsky
This CL is a manual backport of CLs 403837 and 404914 to Go 1.18. CL 403837 was intended just as a simplification CL, but evidently it also fixed #51840. However, for backporting to Go 1.18, the existing logic needs to be preserved to support -G=0 mode (which still relies on Ntype). Fixes #51849. Change-Id: Ib060b0bc67ecf26de8a65d5b4d2f8a65cd547517 Reviewed-on: https://go-review.googlesource.com/c/go/+/405436 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: Keith Randall <khr@google.com>