]> Cypherpunks repositories - gostls13.git/commit
cmd/asm, cmd/compile, runtime: add -spectre=ret mode
authorRuss Cox <rsc@golang.org>
Fri, 17 Jan 2020 18:54:30 +0000 (13:54 -0500)
committerRuss Cox <rsc@golang.org>
Fri, 13 Mar 2020 19:05:54 +0000 (19:05 +0000)
commitfc8a6336d1ad29acf2c7728ce669df9059169132
tree4121580d23be8c08aa0a7b0077254035ecb4473b
parent877ef86bec593cd7e40899ac5446791e65b47839
cmd/asm, cmd/compile, runtime: add -spectre=ret mode

This commit extends the -spectre flag to cmd/asm and adds
a new Spectre mitigation mode "ret", which enables the use
of retpolines.

Retpolines prevent speculation about the target of an indirect
jump or call and are described in more detail here:
https://support.google.com/faqs/answer/7625886

Change-Id: I4f2cb982fa94e44d91e49bd98974fd125619c93a
Reviewed-on: https://go-review.googlesource.com/c/go/+/222661
Reviewed-by: Keith Randall <khr@golang.org>
13 files changed:
src/cmd/asm/internal/flags/flags.go
src/cmd/asm/main.go
src/cmd/compile/internal/gc/main.go
src/cmd/internal/obj/arm/asm5.go
src/cmd/internal/obj/arm64/asm7.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/mips/asm0.go
src/cmd/internal/obj/riscv/obj.go
src/cmd/internal/obj/s390x/asmz.go
src/cmd/internal/obj/x86/asm6.go
src/runtime/asm_amd64.s
src/runtime/stubs_amd64.go
test/codegen/retpoline.go [new file with mode: 0644]