- 07 Feb, 2018 3 commits
-
-
Russ Cox authored
Both gcc and clang accept an option -fplugin=code.so to load a plugin from the ELF shared object file code.so. Obviously that plugin can then do anything it wants during the build. This is contrary to the goal of "go get" never running untrusted code during the build. (What happens if you choose to run the result of the build is your responsibility.) Disallow this behavior by only allowing a small set of known command-line flags in #cgo CFLAGS directives (and #cgo LDFLAGS, etc). The new restrictions can be adjusted by the environment variables CGO_CFLAGS_ALLOW, CGO_CFLAGS_DISALLOW, and so on. See the documentation. In addition to excluding cgo-defined flags, we also have to make sure that when we pass file names on the command line, they don't look like flags. So we now refuse to build packages containing suspicious file names like -x.go. A wrinkle in all this is that GNU binutils uniformly accept @foo on the command line to mean "if the file foo exists, then substitute its contents for @foo in the command line". So we must also reject @x.go, flags and flag arguments beginning with @, and so on. Fixes #23672, CVE-2018-6574. Change-Id: I59e7c1355155c335a5c5ae0d2cf8fa7aa313940a Reviewed-on: https://team-review.git.corp.google.com/209949Reviewed-by: Ian Lance Taylor <iant@google.com>
-
Michael Hudson-Doyle authored
The linker contains complicated logic for figuring out which float ABI to indicate it is using on (32 bit) ARM systems: it parses a special section in host object files to look for a flag indicating use of the hard float ABI. When loadelf got split into its own package a bug was introduced: if the last host object file does not contain a float ABI related tag, the ELF header's flag was set to 0, rather than using the value from the last object file which contained an ABI tag. Fix the code to only change the value used for the ELF header if a tag was found. This fixes an extremely confusing build failure on Ubuntu's armhf builders. Change-Id: I0845d68d082d1383e4cae84ea85164cdc6bcdddb Reviewed-on: https://go-review.googlesource.com/92515 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
CL 49490 fixed a warning when compiling the C code generated by cgo, but it introduced typedef conflicts in Go code that cgo is supposed to avoid. Original CL description: cmd/cgo: fix for function taking pointer typedef Fixes #19832 Updates #19832 Fixes #23720 Change-Id: I22a732db31be0b4f7248c105277ab8ee44ef6cfb Reviewed-on: https://go-review.googlesource.com/92455 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Austin Clements <austin@google.com>
-
- 06 Feb, 2018 5 commits
-
-
Keith Randall authored
When loading multiple elements of an array into a single register, make sure we treat them as unsigned. When treated as signed, the upper bits might all be set, causing the shift-or combo to clobber the values higher in the register. Fixes #23719. Change-Id: Ic87da03e9bd0fe2c60bb214b99f846e4e9446052 Reviewed-on: https://go-review.googlesource.com/92335 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ilya Tocar <ilya.tocar@intel.com>
-
Russ Cox authored
If A's external test package imports B, which imports A, and A's (internal) test code also adds something to A that invalidates anything in the export data from a build of A without its test code, then strictly speaking we need to rebuild B against the test-augmented version of A before using it to build A's external test package. We've been skating by without doing this for a very long time, but I knew we'd need to handle it better eventually, I planned for it in the new build cache simplifications, and the code was ready. Now that we have a real-world test case that needs it, turn on the "proper rebuilding" code. It doesn't really matter how much things slow down, since a real-world test cases that caused an internal compiler error before is now handled correctly, but it appears to be small: I wasn't able to measure an effect on "go test -a -c fmt". And of course most builds won't use -a and will be cached well. Fixes #6204. Fixes #23701. Change-Id: I2cd60cf400d1928428979ab05831f48ff7cee6ca Reviewed-on: https://go-review.googlesource.com/92215 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
The new break and continue actions do not work in html/template, and fixing them requires thinking about security issues that seem too tricky at this stage of the release. We will try again for 1.11. Original CL description: text/template: add break, continue actions in ranges Adds the two range control actions "break" and "continue". They act the same as the Go keywords break and continue, but are simplified in that only the innermost range statement can be broken out of or continued. Fixes #20531 Updates #20531 Updates #23683 Change-Id: Ia7fd3c409163e3bcb5dc42947ae90b15bdf89853 Reviewed-on: https://go-review.googlesource.com/92155 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Daniel Martí authored
For example, the following program is valid: type T struct { f interface{} } func main() { fmt.Printf("%s", T{"foo"}) // prints {foo} } Since the field is of type interface{}, we might have any value in it. For example, if we had T{3}, fmt would complain. However, not knowing what the type under the interface is, we must be conservative. However, as shown in #17798, we should issue an error if the field's type is statically known to implement the error or fmt.Stringer interfaces. In those cases, the user likely wanted the %s format to call those methods. Keep the vet error in those cases. While at it, add more field type test cases, such as custom error types, and interfaces that extend the error interface. Fixes #23563. Change-Id: I063885955555917c59da000391b603f0d6dce432 Reviewed-on: https://go-review.googlesource.com/90516 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
fanzha02 authored
The current code encodes the wrong option value in the binary. The fix reconstructs the function opxrrr() that does not encode the option value into the binary value when arguments is sign or zero-extended register. Add the relevant test cases and negative tests. Fixes #23501 Change-Id: Ie5850ead2ad08d9a235a5664869aac5051762f1f Reviewed-on: https://go-review.googlesource.com/88876 Run-TryBot: Cherry Zhang <cherryyz@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
- 05 Feb, 2018 3 commits
-
-
Ian Lance Taylor authored
Updates #23694 Change-Id: I5fdad8cceacb8bbc85ca2661eb6482aa80343656 Reviewed-on: https://go-review.googlesource.com/92075 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Andrew Bonventre authored
The speed of feature development for these products outpaces the standard Go 6-month release cycle tied to this page. The cost of maintaining this list is becoming a burden as we make every attempt at being impartial. As of this writing, we believe feature lists belong on the pages of the editors/IDEs themselves. Change-Id: Ie2dfe0e0d47d203c913373e58cbb65cb0fb14d0c Reviewed-on: https://go-review.googlesource.com/91976Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Ian Lance Taylor authored
Otherwise we get into a dependency loop as we try to apply coverage analysis to sync/atomic when the coverage analysis itself requires sync/atomic. Fixes #23694 Change-Id: I3a74ef3881ec5c6197ed348acc7f9e175417f6c7 Reviewed-on: https://go-review.googlesource.com/91875 Run-TryBot: Ian Lance Taylor <iant@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
- 02 Feb, 2018 5 commits
-
-
Russ Cox authored
Was improperly bypassed in a couple places. Change-Id: I13426b3efe68b9e67324c283540d0ef7b81b3d41 Reviewed-on: https://go-review.googlesource.com/91636 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
The old and exp packages listed in gccgoinstallation_test.go have been removed from gccgo. Remove them from the test. Fixes #20932 Change-Id: I04a5148e18dccef332904b836c42098b55f2516c Reviewed-on: https://go-review.googlesource.com/91656 Run-TryBot: Ian Lance Taylor <iant@golang.org> Run-TryBot: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Ian Lance Taylor authored
The dlopen function returns an opaque handle, and it is possible for it to look like a Go pointer, causing garbage collector and cgo confusion. Fixes #23663 Change-Id: Id080e2bbcee8cfa7ac4a457a927f96949eb913f8 Reviewed-on: https://go-review.googlesource.com/91596 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Robert Griesemer authored
The EBNF production Function = Signature FunctionBody . was used in FunctionDecl, MethodDecl, and FunctionLit, but only for the latter it shortened the syntax slightly. This change "inlines" Function which simplifies FunctionDecl and MethodDecl and gets rid of the Function production. This has no impact on the specified language. Also, the Function production is never referred to by the prose, so it's safe to remove it from the spec. Finally, neither go/ast nor go/parser have a representation of this production via a corresponding node or parse function, so no possibly valuable documentation is lost, either. Change-Id: Ia2875d31c6ec2d2079081ef481e50bad4f43c694 Reviewed-on: https://go-review.googlesource.com/91515Reviewed-by: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Mikio Hara authored
Fixes #23653. Change-Id: Ic1e3c8f156ae576cfb5da1b4d082d4b12fae114f Reviewed-on: https://go-review.googlesource.com/91317 Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
- 31 Jan, 2018 10 commits
-
-
David du Colombier authored
CL 91097 added TestNoCache. However, this test is failing on Plan 9 because the HOME environment variable doesn't contain the home directory where the Go cache is located. This change fixes the TestNoCache test by using the home environment variable instead of HOME on Plan 9. Fixes #23644. Change-Id: Icfb7a7a4c2852f159c93032b4081411628a2787f Reviewed-on: https://go-review.googlesource.com/91216 Run-TryBot: David du Colombier <0intro@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Austin Clements authored
preparePanic must set all registers expected by Go runtime conventions in case the sigpanic is being injected into C code. However, on mips64x it fails to restore RSB (R28). As a result, if C code modifies RSB and then raises a signal that turns into a sigpanic call, sigpanic may crash when it attempts to lock runtime.debuglock (the first global it references). Fix this by restoring RSB in the signal context using the same convention as main and sigtramp. Fixes #23641. Change-Id: Ib47e83df89e2a3eece10f480e4e91ce9e4424388 Reviewed-on: https://go-review.googlesource.com/91156 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Austin Clements authored
Currently, gentraceback suppresses the "unexpected return pc" error for sigpanic's caller if the M was running C code. However, there are various situations where a sigpanic is injected into C code that can cause traceback to unwind *past* the sigpanic before realizing that it's in trouble (the traceback beyond the sigpanic will be wrong). Rather than try to fix these issues for Go 1.10, this CL simply disables complaining about unexpected return PCs if we're in cgo regardless of whether or not they're from the sigpanic frame. Go 1.9 never complained about unexpected return PCs when printing, so this is simply a step closer to the old behavior. This should fix the openbsd-386 failures on the dashboard, though this issue could affect any architecture. Fixes #23640. Change-Id: I8c32c1ee86a70d2f280661ed1f8caf82549e324b Reviewed-on: https://go-review.googlesource.com/91136 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Tobias Klauser authored
The getdents64 syscall is only available for mips64/mips64le starting with Linux kernel 3.10. Since mips64le requires at least 4.8 according to [1] (regarding #16848) using it should be fine. [1] https://golang.org/wiki/MinimumRequirements This CL changes the binary layout of type Dirent for mips64/mips64le, but not the public API. But since the currently used layout doesn't match the struct linux_dirent returned by the getdents syscall this should be fine as well. Fixes #23624 Change-Id: Iaa7306fa6e4442ad2fed41c60b37627a7314f117 Reviewed-on: https://go-review.googlesource.com/91055Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Cherry Zhang authored
The fix is CL 91035. Build only with gccgo at the moment, as it hits issue #23546. Updates #23545. Change-Id: I3a1367bb31b04773d31f71016f8fd7bd1855d7b5 Reviewed-on: https://go-review.googlesource.com/89735 Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
Fixes #23638 Change-Id: I51967290448217f371fc7aba9259918ee9857143 Reviewed-on: https://go-review.googlesource.com/91097 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-
Austin Clements authored
If we're running C code and the code panics, the runtime will inject a call to sigpanic into the C code just like it would into Go code. However, the return PC from this sigpanic will be in C code. We used to silently abort the traceback if we didn't recognize a return PC, so this went by quietly. Now we're much louder because in general this is a bad thing. However, in this one particular case, it's fine, so if we're in cgo and are looking at the return PC of sigpanic, silence the debug output. Fixes #23576. Change-Id: I03d0c14d4e4d25b29b1f5804f5e9ccc4f742f876 Reviewed-on: https://go-review.googlesource.com/90896 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Austin Clements authored
asmcgocall switches to the system stack and aligns the SP, so gentraceback both can't unwind over it when it appears on the system stack (it'll read some uninitialized stack slot as the return PC). There's also no point in unwinding over it, so don't. Updates #23576. Change-Id: Idfcc9599c7636b80dec5451cb65ae892b4611981 Reviewed-on: https://go-review.googlesource.com/90895 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Michael Hudson-Doyle authored
This happens in a chroot and so causes failures when packaging Go 1.10 for Debian/Ubuntu. Change-Id: I817038c237e584ce185b2168f8c7a10b9ef27b43 Reviewed-on: https://go-review.googlesource.com/90875 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Michael Hudson-Doyle authored
Upstream PRs: https://github.com/google/pprof/pull/305, https://github.com/google/pprof/pull/306. Change-Id: I28969118f52ee08fcaf3572ad5da015ae756fd7a Reviewed-on: https://go-review.googlesource.com/90935 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 30 Jan, 2018 7 commits
-
-
Brad Fitzpatrick authored
Also close </li> tags. Fixes #23614 Change-Id: Icabcd577ef7df43e54d2b0068ee54614ba65bea1 Reviewed-on: https://go-review.googlesource.com/90815Reviewed-by: Cherry Zhang <cherryyz@google.com>
-
Mohit Agarwal authored
Executing $ go tool dist test -run=^go_test:cmd/fix$ leaves a number of directories (fix_cgo_typecheck*) in TMPDIR. Change-Id: Ia5bdc2f7d884333771d50365063faf514ebf6eae Reviewed-on: https://go-review.googlesource.com/90795 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Ian Lance Taylor authored
Updates #22912 Fixes #23610 Change-Id: Id1c91fc3f040412d5931dba40e430685793f8eea Reviewed-on: https://go-review.googlesource.com/90715 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Daniel Martí authored
For example, the following program is valid: func main() { fmt.Printf("%[1]d", 1, 2, 3) } If any of the formats are indexed, fmt will not complain about unused extra arguments. See #22867 for more detail. Make vet follow the same logic, to avoid erroring on programs that would run without fmt complaining. Fixes #23564. Change-Id: Ic9dede5d4c37d1cd4fa24714216944897b5bb7cc Reviewed-on: https://go-review.googlesource.com/90495 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Daniel Martí authored
vet was quiet for []stringer, but not for [N]stringer. The source of the problem was how the recursive call used .Elem().Underlying() for arrays, but .Elem() for slices. In the first case, the named type is dropped, thus losing all information of attached methods. Be consistent across slices and arrays, by dropping the Underlying call that is causing trouble. Add regression tests too, including cases where the element type does not implement fmt.Stringer. Fixes #23552. Change-Id: I0fde07d101f112d5768be0a79207ef0b3dc45f2e Reviewed-on: https://go-review.googlesource.com/90455 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Daniel Martí authored
vet recorded what types had String methods defined on them, but it did not record whether the receivers were pointer types. That information is important, as the following program is valid: type T string func (t *T) String() string { return fmt.Sprint(&t) // prints address } Teach vet that, if *T is Stringer, **T is not. Fixes #23550. Change-Id: I1062e60e6d82e789af9cca396546db6bfc3541e8 Reviewed-on: https://go-review.googlesource.com/90417 Run-TryBot: Daniel Martí <mvdan@mvdan.cc> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
-
Rob Pike authored
The problem is that vet complains about 0 as a Printf flag in some situations where fmt allows it but probably shouldn't. The two need to be brought in line, but it's too late in the release cycle. The situation is messy and should be resolved properly in 1.11. This CL is a simple fix to disable a spurious complaint for 1.10 that will be resolved in a more thorough way in 1.11. The workaround is just to be silent about flag 0, as suggested in issue 23605. Fixes #23605 Update #23498 Change-Id: Ice1a4f4d86845d70c1340a0a6430d74e5de9afd4 Reviewed-on: https://go-review.googlesource.com/90695 Run-TryBot: Rob Pike <r@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 29 Jan, 2018 2 commits
-
-
Mohit Agarwal authored
Change-Id: I802bc11d90d414e7313dd11842a04fd6b591ea06 Reviewed-on: https://go-review.googlesource.com/90595Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
Alberto Donizetti authored
Change-Id: If928b14f6cd89b1d78745e8bc7a081ccbd7fd38f Reviewed-on: https://go-review.googlesource.com/90515Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
- 28 Jan, 2018 1 commit
-
-
David du Colombier authored
CL 13166, CL 13342 and CL 33425 skipped external tests on freebsd/arm, linux/arm and linux/mips. This CL does the same for plan9/arm to reduce test time on plan9/arm and prevent the Go builder to time out. Change-Id: I16fcc5d8010a354f480673b8c4a8a11dbc833557 Reviewed-on: https://go-review.googlesource.com/90416 Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
-
- 26 Jan, 2018 2 commits
-
-
Kevin Burke authored
Change-Id: I7bf1a93d3377acccdd3a34c5dcef7863310496e0 Reviewed-on: https://go-review.googlesource.com/89955Reviewed-by: Ian Lance Taylor <iant@golang.org>
-
Austin Clements authored
Fixes #23570. Change-Id: I462ada2960d710c2c94dc22a59d292703d83f612 Reviewed-on: https://go-review.googlesource.com/90255Reviewed-by: Russ Cox <rsc@golang.org>
-
- 25 Jan, 2018 2 commits
-
-
Austin Clements authored
recover determines whether it's being called by a deferred frame by matching its caller's argument frame pointer with the one recorded in the panic object. That means its caller needs a valid and unique argument frame pointer, so it must not be inlined. With this fix, test/recover.go passes with -l=4. Fixes #23557. Change-Id: I1f32a624c49e387cfc67893a0829bb248d69c3d4 Reviewed-on: https://go-review.googlesource.com/90035 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
-
Daniel Theophanes authored
Previously we allowed drivers to modify the row buffer used to scan values when closing Rows. This is no longer acceptable and can lead to data races. Fixes #23519 Change-Id: I91820a6266ffe52f95f40bb47307d375727715af Reviewed-on: https://go-review.googlesource.com/89936 Run-TryBot: Daniel Theophanes <kardianos@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
-