]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.14] gh-139808: Add branch protections for aarch64 in asm_trampoline.S (#130864...
authorVictor Stinner <vstinner@python.org>
Thu, 21 May 2026 16:41:26 +0000 (18:41 +0200)
committerGitHub <noreply@github.com>
Thu, 21 May 2026 16:41:26 +0000 (18:41 +0200)
commitc863e96455ea8b7f1e958eb0c9e188b05f7770a4
tree384fad662cd7ad2e526ce3bedcc95058da4e7dae
parent1d4f9ab0c66378790a2482b76d84462ef0d23cf2
[3.14] gh-139808: Add branch protections for aarch64 in asm_trampoline.S (#130864) (#150189)

gh-139808: Add branch protections for aarch64 in asm_trampoline.S (#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 da8477b25c6124c961306d4d7cd5ec7dafda6be4)

Co-authored-by: stratakis <cstratak@redhat.com>
Misc/NEWS.d/next/Core_and_Builtins/2026-05-12-16-47-23.gh-issue-139808.iIs7_E.rst [new file with mode: 0644]
Python/asm_trampoline.S
Python/asm_trampoline_aarch64.h [new file with mode: 0644]
Python/perf_jit_trampoline.c