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

Force non-executable stack for assembly object files on Linux #170

Merged
merged 3 commits into from
Feb 24, 2025

Conversation

eparshut
Copy link
Contributor

Starting with binutils 2.39:

The ELF linker will now generate a warning message if the stack is made executable. Similarly it will warn if the output binary contains a segment with all three of the read, write and execute permission bits set. These warnings are intended to help developers identify programs which might be vulnerable to attack via these executable memory regions.

Normally, the stack is marked as non-executable by the C compiler, but when you are using raw assembly it gets marked as executable, the assumption being that assembly authors want an executable stack. Adding the .note.GNU-stack section at the bottom of the .s files tells the linker the stack shouldn't be executable.

Updated header copyrights in assembly source files in addition

@eparshut eparshut requested review from abrown and ichepiga February 24, 2025 19:38
@eparshut eparshut merged commit dec1d23 into intel:master Feb 24, 2025
16 checks passed
@eparshut eparshut deleted the executable_stack branch February 24, 2025 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants