]> Cypherpunks repositories - gostls13.git/commit
runtime: mlock top of signal stack on Linux 5.2–5.4.1
authorAustin Clements <austin@google.com>
Mon, 2 Dec 2019 22:36:25 +0000 (17:36 -0500)
committerAustin Clements <austin@google.com>
Thu, 5 Dec 2019 01:48:14 +0000 (01:48 +0000)
commit8174f7fb2b64c221f7f80c9f7fd4d7eb317ac8bb
tree14e617cf022bfc197221468d24c1a66bed6c193c
parentfa3a121a79f85a4c957f29372b5ebfde7211a980
runtime: mlock top of signal stack on Linux 5.2–5.4.1

Linux 5.2 introduced a bug that can corrupt vector registers on return
from a signal if the signal stack isn't faulted in:
https://bugzilla.kernel.org/show_bug.cgi?id=205663

This CL works around this by mlocking the top page of all Go signal
stacks on the affected kernels.

Fixes #35326, #35777

Change-Id: I77c80a2baa4780827633f92f464486caa222295d
Reviewed-on: https://go-review.googlesource.com/c/go/+/209899
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/runtime/defs_linux_amd64.go
src/runtime/os_linux.go
src/runtime/os_linux_386.go [new file with mode: 0644]
src/runtime/os_linux_amd64.go [new file with mode: 0644]
src/runtime/os_linux_arm.go
src/runtime/os_linux_arm64.go
src/runtime/os_linux_mips64x.go
src/runtime/os_linux_mipsx.go
src/runtime/os_linux_ppc64x.go
src/runtime/os_linux_s390x.go
src/runtime/sys_linux_amd64.s