Skip to content

asm_trampoline.S misses branch protection flags for x86_64 #128605

Closed

Description

@stratakis

Bug report

Bug description:

asm_trampoline.S added here 6d791a9 misses the branch protections offered for the latest x86-64 and aarch64 processors.

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

Hardened: libpython3.14.so.1.0: FAIL: cf-protection test because no .note.gnu.property section = no control flow information
Hardened: libpython3.14.so.1.0: FAIL: property-note test because a property note was found but it shows that cf-protection is not enabled

Relevant annobin documentation:
x86_64: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html
aarch64: https://sourceware.org/annobin/annobin.html/Test-branch-protection.html

CPython versions tested on:

3.12, 3.13, 3.14, CPython main branch

Operating systems tested on:

Linux

Linked PRs

Activity

  1. added a commit that references this issue on Jun 3, 2025
  2. added 2 commits that reference this issue on Jun 3, 2025
  3. added a commit that references this issue on Jun 3, 2025
  4. added a commit that references this issue on Jun 3, 2025
  5. added a commit that references this issue on Jun 3, 2025
  6. added a commit that references this issue on Jun 3, 2025
  7. encukou commented on Jun 4, 2025

    @encukou
    Member

    It looks like the backports broke buildbots,see for example:

  8. stratakis commented on Jun 4, 2025

    @stratakis
    ContributorAuthor

    Isn't it the same failure as #131038 ?

  9. added and removed
    type-bugAn unexpected behavior, bug, or error
    on Jun 5, 2025
  10. added a commit that references this issue on Jun 5, 2025
  11. encukou commented on Jun 5, 2025

    @encukou
    Member

    Maybe!
    This one always fails though, and for Tier 1 platforms, the policy is to revert and then investigate (unless we have a quick fix). Keeping the buildbots green allows them to catch other bugs.

  12. 9 remaining items

  13. added a commit that references this issue on Jun 10, 2025
  14. added 2 commits that reference this issue on Jun 10, 2025
  15. added a commit that references this issue on Jul 10, 2025
  16. added a commit that references this issue on Jul 12, 2025
  17. added a commit that references this issue on Aug 4, 2025
  18. encukou commented on Aug 15, 2025

    @encukou
    Member

    @stratakis, I don't think there's more to do here (and in #130864). Is that right?

  19. added
    pendingThe issue will be closed if no feedback is provided
    on Aug 15, 2025
  20. stratakis commented on Aug 15, 2025

    @stratakis
    ContributorAuthor

    For x86_64 nope but aarch64 is still an issue unfortunately.

    My original intention was to do that on one PR/issue but since x86_64 was fixed I can either close this one and file a new for aarch64 or keep this open till #130864 is resolved.

  21. vstinner commented on Aug 16, 2025

    @vstinner
    Member

    I suggest to open a new issue for aarch64 and limit this one to x86_64.

  22. added a commit that references this issue on Aug 19, 2025
  23. changed the title [-]asm_trampoline.S misses branch protection flags for x86_64 and aarch64[/-] [+]asm_trampoline.S misses branch protection flags for x86_64[/+] on Oct 8, 2025
  24. stratakis commented on Oct 8, 2025

    @stratakis
    ContributorAuthor

    Closing this issue as it's superseded by #139808

  25. removed
    pendingThe issue will be closed if no feedback is provided
    on Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-securityA security issue

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions