Skip to content

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

Merged
eparshut merged 3 commits intointel:masterfrom
eparshut:executable_stack
Feb 24, 2025
Merged

Force non-executable stack for assembly object files on Linux#170
eparshut merged 3 commits intointel:masterfrom
eparshut:executable_stack

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

Comments