Skip to content

include noexecstack hardening flag on Linux#1064

Open
jjhelmus wants to merge 1 commit intoastral-sh:mainfrom
jjhelmus:noexecstack
Open

include noexecstack hardening flag on Linux#1064
jjhelmus wants to merge 1 commit intoastral-sh:mainfrom
jjhelmus:noexecstack

Conversation

@jjhelmus
Copy link
Copy Markdown
Contributor

Mark the stack memory as non-executable using the '-Wl,-z,noexecstack' flag on aarch64 and x86_64 linux platforms.

Other linux targets are cross-compiled, this flag is left off for the time being.

closes #1061

Mark the stack memory as non-executable using the
'-Wl,-z,noexecstack' flag on aarch64 and x86_64 linux platforms.

Other linux targets are cross-compiled, this flag is left off for the
time being.

closes astral-sh#1061
@jjhelmus jjhelmus requested review from geofft, indygreg and zanieb March 27, 2026 21:21
@jjhelmus
Copy link
Copy Markdown
Contributor Author

jjhelmus commented Mar 27, 2026

Testing this locally confirms this addresses #1061

❯ execstack -q python/install/lib/libpython3.14.so
- python/install/lib/libpython3.14.so

This change does not address #956

@jjhelmus jjhelmus added the platform:linux Specific to the Linux platform label Mar 27, 2026
Copy link
Copy Markdown
Collaborator

@indygreg indygreg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a follow-up, please teach the ELF validation code to ensure that the stack isn't executable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

platform:linux Specific to the Linux platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

20260320 builds seem to have executable-stack set on python shared library

2 participants