-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: add more options to security whitelist #23937
Comments
More options to add to the whitelists: From #23904:
From #23909:
From #23923:
(Note that From #23749:
(We currently accept |
From #23749:
|
From #23938:
|
(You meant to say 23904 instead of 23094 there; in case that bug accidentally gets marked as fixed by this fix.) |
Thanks; I updated the comment. |
Reported on #23749:
|
(Oops, missed it: likewise for 23090. Not sure what the right issue number there is.) Seconding |
|
Corrected issue reference in comment above. Thanks. Go itself does not even know about the |
No; I meant to ask what does Go set in the Mach-O headers for the minimum version. I can make that a separate discussion, though. |
@andlabs Currently when using internal linking the program requests OS X version 10.7.0. When using external linking it's set by the system linker. Let's take any followup on this to golang-nuts. |
From #23749:
|
|
I am starting to see a number of people on my own project assume that the consequences of the security fix are bugs in my project specifically — people are updating Go without realizing the security patch exists in in the first place. I'll be editing up my README, but I have to wonder what other projects also have this problem — and worse, what missing options have gone unnoticed by us as a result. To further address the lack of information-spreading, I wonder if the error message from cgo should point to the security fix announcement as well. Furthermore, at least two people are resorting to setting the |
@andlabs In 1.10 the error message points to https://golang.org/s/invalidflag, and in 1.9.5 it will as well. |
From #24113:
|
From #23749:
|
From #23749: LDFLAGS: -Wl,-z,relro |
Might be a good idea to ask the user to use CGO_CFLAGS_ALLOW and friends to find out if there are more flags not in the sample code. |
From #23749:
|
From #23749: -isysroot (ios) -target (for android) @eliasnaur Are these compiler options or linker options? |
-target and --sysroot are put in CFLAGS, CPPFLAGS and LDFLAGS by gomobile on android. Note that I spelled --sysroot with one dash in #23749. Sorry. -mios-simulator-version-min=, -miphoneos-version-min=, and -isysroot are passed to CFLAGS and LDFLAGS by gomobile on ios. |
(You should probably put those iOS CFLAGS into CXXFLAGS as well, lest someone using Objective-C++ be blocked.) |
I found another one: "-arch ". It's added to all of CFLAG, CPPFLAG, and LDFLAG and isn't the same as -march. |
|
From #23749 (comment) |
A couple more CFLAGS that I ran into in my current project: |
From a security standpoint, on Darwin this is also an important flag for adding the |
@JakeDOD what is this |
@andlabs More generally, it allows a macOS binary to opt-in as a restricted binary and tell DYLD to prune dangerous environment variables like |
In case they're missed: From #23749 (comment)
From #23749 (comment) |
Change https://golang.org/cl/102818 mentions this issue: |
Reopening for 1.10.1 and 1.9.5 cherry picks. |
CL 102818 OK for Go 1.10.1 |
Change https://golang.org/cl/103015 mentions this issue: |
Change https://golang.org/cl/103156 mentions this issue: |
…whitelist Fixes #23937 Change-Id: Ie63d91355d1a724d0012d99d457d939deeeb8d3e Reviewed-on: https://go-review.googlesource.com/102818 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Andrew Bonventre <[email protected]> Reviewed-on: https://go-review.googlesource.com/103156 Run-TryBot: Andrew Bonventre <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
… whitelist Fixes #23937 Change-Id: Ie63d91355d1a724d0012d99d457d939deeeb8d3e Reviewed-on: https://go-review.googlesource.com/102818 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Andrew Bonventre <[email protected]> Reviewed-on: https://go-review.googlesource.com/103015 Run-TryBot: Andrew Bonventre <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
What version of Go are you using (
go version
)?Go 1.10
What operating system and processor architecture are you using (
go env
)?MacOS 10.13.2
Debian Jessie 3.16.0-4-amd64
What did you do?
Build code cgo code which includes the evaluated output of
The output of
mapnik-config --cxxflags
is as follows (for two different versions):and
What did you see instead?
For the first version:
It works with the following env:
CGO_CXXFLAGS_ALLOW='-ansi|-finline-functions'
For the second version:
CGO_CXXFLAGS_ALLOW='-stdlib=.*|-fvisibility=hidden|-fvisibility-inlines-hidden|-ftemplate-depth[=-]\d+
-stdlib
is already included in master, but the other options are missing. Note that-ftemplate-depth-300
uses-
instead of=
.The text was updated successfully, but these errors were encountered: