-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
asm_trampoline.S misses BTI/PAC protection flags for aarch64 #139808
Copy link
Copy link
Closed
Labels
3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixes3.15pre-release feature fixes, bugs and security fixespre-release feature fixes, bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Fields
Give feedbackNo fields configured for issues without a type.
Bug report
Bug description:
asm_trampoline.S added here 6d791a9 misses the BTI/PAC protections offered for the latest aarch64 processors when using the
-mbranch-protection=<protection>flag.For C code the compiler takes care of that, however for the assembler files the relevant instructions need to be added manually.
This was discovered by running the annobin-annocheck tool on a Fedora machine:
$ annocheck --hardened libpython3.14.so.1.0
When the protections are there, the binary/library should read:
$ readelf -n libpython3.14.so.1.0 | grep Properties
Properties: AArch64 feature: BTI, PACWhile adding the instructions is simple enough, more complexity arises due to Perf requiring to work without frame pointers from 3.13+.
Relevant documentation: https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/enabling-pac-and-bti-on-aarch64
CPython versions tested on:
CPython main branch, 3.15, 3.14, 3.13, 3.12
Operating systems tested on:
Linux
Linked PRs