-
Notifications
You must be signed in to change notification settings - Fork 119
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
Use -buildmode=pie (Position Independent Code/ Executable) #30
Comments
We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/113966315. |
Hi @jcscottiii, Thanks for proposing this feature! I'd like to better understand the advantages of generating PIE code -- can you provide a bit of context around why you think it's better, and what advantages (as specifically as you can) you'll get if the buildpack does this? |
Hey @flavorjones!! Background: PIE / PIC is typically done to thwart exploits originating from buffer overflow. Without the address randomization of PIE / PIC, an attacker's code can smashes the stack and with the knowledge of your app's address layout, can overwrite the return address to a function of method in your code that is something a normal user should never have access to execute. My background:
Why:
Current threat to Go: There have not been any reports of stack smashing within Go itself. (However, you can read this) Potential Target: The vulnerable surface area would be limited to the data in a Warden or Garden container. This includes environment variables which could contain sensitive authentication data. A Potential (Wild In My Head That Could Be Wrong / Highly Improbable) Scenario:
Disadvantage: A common disadvantage is that the executable will take more space and could be slightly slower. |
This seems like a totally reasonable thing to do. I'll chat with the team about it! |
@jcscottiii Thanks for your input! We've included this change into our develop branch. For more information see this commit |
@Dannyzen thanks!! |
Closing this issue as it's in our develop branch and will be made available on the next go-buildpack release. Thanks for bringing this to our attention @jcscottiii |
@jcscottiii this has been included in go-buildpack 1.7.4 |
Go v1.6 brought about the introduction of
-buildmode=pie
. However, it only is supported by some platforms including:linux/386, linux/amd64, linux/arm, linux/arm64, and linux/ppc64le
. Since it is not supported for all, I suspect that is why it is not default. However, it would be nice to support a way to trigger this when building.https://golang.org/doc/go1.6#compiler
The text was updated successfully, but these errors were encountered: