Skip to content
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 -flat_namespace to LDFLAGS whitelist #26173

Closed
crawshaw opened this issue Jul 1, 2018 · 4 comments
Closed

cmd/go: add -flat_namespace to LDFLAGS whitelist #26173

crawshaw opened this issue Jul 1, 2018 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@crawshaw
Copy link
Member

crawshaw commented Jul 1, 2018

The approximate macOS equivalent to linux's -Wl,--unresolved-symbols=ignore is -Wl,-undefined,suppress. It is whitelisted, but using it requires setting the linker flag -flat_namespace, which is not on the whitelist.

The Apple documentation reads:

-flat_namespace
            Alters how symbols are resolved at build time and runtime.  With
            -two_levelnamespace (the default), the linker only searches dylibs
            on the command line for symbols, and records in which dylib they
            were found.  With -flat_namespace, the linker searches all dylibs
            on the command line and all dylibs those original dylibs depend
            on.  The linker does not record which dylib an external symbol
            came from, so at runtime dyld again searches all images and uses
            the first definition it finds.  In addition, any undefines in
            loaded flat_namespace dylibs must be resolvable at build time.

I thought about it a bit and cannot see any way this can cause arbitrary code execution. Could it be included on the whitelist?

Thanks.

cc @ianlancetaylor

@crawshaw
Copy link
Member Author

crawshaw commented Jul 1, 2018

I would assign this the Go1.11 label as I would like to see it in the next release, but apparently I was removed from the go github organization. (Presumably some helpful shell script somewhere.)

@gopherbot
Copy link

Change https://golang.org/cl/121819 mentions this issue: cmd/go: add -flat_namespace to LDFLAGS whitelist

@mvdan mvdan added this to the Go1.11 milestone Jul 1, 2018
@mvdan
Copy link
Member

mvdan commented Jul 1, 2018

@crawshaw I'm sure you'd be given full access to the issue tracker again if you filed an issue about it :) https://github.com/golang/go/wiki/GithubAccess

@FiloSottile
Copy link
Contributor

By the way, this is a thing now: @gopherbot please label NeedsFix. But looks like you have access again.

@gopherbot gopherbot added the NeedsFix The path to resolution is known, but the work has not been done. label Jul 2, 2018
@golang golang locked and limited conversation to collaborators Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants