Skip to content

[validation] Reject ELF files with executable stack - #2

Closed
1998LJ wants to merge 2 commits into
mainfrom
fix/634-executable-stack
Closed

1998LJ wants to merge 2 commits into
mainfrom
fix/634-executable-stack

Conversation

@1998LJ

@1998LJ 1998LJ commented Sep 25, 2026 •

Copy link
Copy Markdown
Owner

Validation PR for pypa#634.

What changed

  • Detect PT_GNU_STACK segments carrying the executable (PF_X) flag with pyelftools.
  • Re-scan the fully repaired wheel tree after patching, including shared libraries grafted during repair.
  • Reject the repair if any final ELF requests an executable stack.
  • Prevent InWheelCtx from writing the rejected wheel while unwinding.
  • Add focused unit coverage for ELF detection and final repaired-tree validation.

Scope

This intentionally does not change auditwheel show and does not automatically clear the executable-stack bit. It implements the minimal rejection behavior requested by pypa#634.

This PR is for fork CI validation before upstream submission.

@1998LJ
1998LJ force-pushed the fix/634-executable-stack branch from 14cbecc to 56501d5 Compare September 25, 2026 04:04
@1998LJ 1998LJ closed this Sep 25, 2026
@1998LJ 1998LJ reopened this Sep 25, 2026
@1998LJ 1998LJ closed this Sep 25, 2026
@1998LJ 1998LJ reopened this Sep 25, 2026

1998LJ commented Sep 25, 2026

Copy link
Copy Markdown
Owner Author

Closing this validation PR because upstream pypa#732 already implements pypa#634 and is actively under review. Keeping the validation branch only as a local record; no upstream submission will be made to avoid duplicating an existing contribution.

@1998LJ 1998LJ closed this Sep 25, 2026
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.

1 participant