Skip to content

Commit 268eaf9

Browse files
committed
cmd/go/internal/security: add -ftls-model to valid compiler flags
Allow -ftls-model to be passed in to a system compiler. It does not allow arbitrary code execution. See https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html#index-ftls-model for documentation for the -ftls-model flag. Fixes #69711 Change-Id: I842a96832e6858e62c171401d13baa3391d6d00a Reviewed-on: https://go-review.googlesource.com/c/go/+/617136 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 8c26947 commit 268eaf9

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/cmd/go/internal/work/security.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ var validCompilerFlags = []*lazyregexp.Regexp{
9191
re(`-f(no-)?visibility-inlines-hidden`),
9292
re(`-fsanitize=(.+)`),
9393
re(`-ftemplate-depth-(.+)`),
94+
re(`-ftls-model=(global-dynamic|local-dynamic|initial-exec|local-exec)`),
9495
re(`-fvisibility=(.+)`),
9596
re(`-g([^@\-].*)?`),
9697
re(`-m32`),

src/cmd/go/internal/work/security_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ var goodCompilerFlags = [][]string{
4747
{"-fstack-xxx"},
4848
{"-fno-stack-xxx"},
4949
{"-fsanitize=hands"},
50+
{"-ftls-model=local-dynamic"},
5051
{"-g"},
5152
{"-ggdb"},
5253
{"-march=souza"},

0 commit comments

Comments
 (0)