[3.13] gh-139808: Add branch protections for aarch64 in asm_trampoline.S (GH-130864) (GH-150189)#150194
[3.13] gh-139808: Add branch protections for aarch64 in asm_trampoline.S (GH-130864) (GH-150189)#150194miss-islington wants to merge 1 commit into
Conversation
…mpoline.S (pythonGH-130864) (pythonGH-150189) pythongh-139808: Add branch protections for aarch64 in asm_trampoline.S (pythonGH-130864) Apply protection against ROP/JOP attacks for aarch64 on asm_trampoline.S. The BTI flag must be applied in assembler sources for this class of attacks to be mitigated on newer aarch64 processors. See also: https://sourceware.org/annobin/annobin.html/Test-branch-protection.html and https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/enabling-pac-and-bti-on-aarch64 The 3.14 backport makes Python/jit_unwind.c changes in Python/perf_jit_trampoline.c. (cherry picked from commit da8477b) (cherry picked from commit c863e96) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: stratakis <cstratak@redhat.com>
Documentation build overview
454 files changed ·
|
|
I tested this change on Fedora 43 AArch64 with commands: Output: The BTI and PAC protections are present as expected. |
|
@stratakis: Here is an automated backport to 3.13 of PR gh-150189 fix. |
|
Unfortunately this is a bit trickier here. While I found everything working, except the case with frame pointers and mbranch protection for the dwarf unwinding path. Although quite niche, other issues might be here, I think this should go on 3.13 only if @pablogsal would think that 5535482 is also cherry-pickable for 3.13. |
|
I think cherry-picking the trampoline fixes before this would be the right move, but it's not for me to decide. |
Ah wait, this commit IS on 3.13. Then I'm not sure what the issue is here. |
Would you mind to elaborate on the issue? Like explain how to reproduce it? |
Actually everything works, forgot the clear the stale perf /tmp/jitted*.so files from the previous test run so something got messy there. |
gh-139808: Add branch protections for aarch64 in asm_trampoline.S (GH-130864)
Apply protection against ROP/JOP attacks for aarch64 on asm_trampoline.S.
The BTI flag must be applied in assembler sources for this class
of attacks to be mitigated on newer aarch64 processors.
See also:
https://sourceware.org/annobin/annobin.html/Test-branch-protection.html
and
https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/enabling-pac-and-bti-on-aarch64
The 3.14 backport makes Python/jit_unwind.c changes in
Python/perf_jit_trampoline.c.
(cherry picked from commit da8477b)
(cherry picked from commit c863e96)
Co-authored-by: Victor Stinner vstinner@python.org
Co-authored-by: stratakis cstratak@redhat.com