1. 11 Dec, 2017 3 commits
    • Austin Clements's avatar
      runtime: reset write barrier buffer on all flush paths · 043f112e
      Austin Clements authored
      Currently, wbBufFlush does nothing if the goroutine is dying on the
      assumption that the system is crashing anyway and running the write
      barrier may crash it even more. However, it fails to reset the
      buffer's "next" pointer. As a result, if there are later write
      barriers on the same P, the write barrier will overflow the write
      barrier buffer and start corrupting other fields in the P or other
      heap objects. Often, this corrupts fields in the next allocated P
      since they tend to be together in the heap.
      
      Fix this by always resetting the buffer's "next" pointer, even if
      we're not doing anything with the pointers in the buffer.
      
      Updates #22987 and #22988. (May fix; it's hard to say.)
      
      Change-Id: I82c11ea2d399e1658531c3e8065445a66b7282b2
      Reviewed-on: https://go-review.googlesource.com/83016
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      043f112e
    • Austin Clements's avatar
      runtime: mark heapBits.bits nosplit · 3675bff5
      Austin Clements authored
      heapBits.bits is used during bulkBarrierPreWrite via
      heapBits.isPointer, which means it must not be preempted. If it is
      preempted, several bad things can happen:
      
      1. This could allow a GC phase change, and the resulting shear between
      the barriers and the memory writes could result in a lost pointer.
      
      2. Since bulkBarrierPreWrite uses the P's local write barrier buffer,
      if it also migrates to a different P, it could try to append to the
      write barrier buffer concurrently with another write barrier. This can
      result in the buffer's next pointer skipping over its end pointer,
      which results in a buffer overflow that can corrupt arbitrary other
      fields in the Ps (or anything in the heap, really, but it'll probably
      crash from the corrupted P quickly).
      
      Fix this by marking heapBits.bits go:nosplit. This would be the
      perfect use for a recursive no-preempt annotation (#21314).
      
      This doesn't actually affect any binaries because this function was
      always inlined anyway. (I discovered it when I was modifying heapBits
      and make h.bits() no longer inline, which led to rampant crashes from
      problem 2 above.)
      
      Updates #22987 and #22988 (but doesn't fix because it doesn't actually
      change the generated code).
      
      Change-Id: I60ebb928b1233b0613361ac3d0558d7b1cb65610
      Reviewed-on: https://go-review.googlesource.com/83015
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      3675bff5
    • Brad Fitzpatrick's avatar
      doc: update NetBSD status · 0da486dc
      Brad Fitzpatrick authored
      Fixes #23073
      
      Change-Id: Ia43b28beeff9e57579caf5dcb76146ee29d5033b
      Reviewed-on: https://go-review.googlesource.com/82918Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      0da486dc
  2. 10 Dec, 2017 2 commits
  3. 09 Dec, 2017 2 commits
  4. 08 Dec, 2017 17 commits
  5. 07 Dec, 2017 13 commits
  6. 06 Dec, 2017 3 commits