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
    type-bug
    on Jan 8, 2025
  2. added
    interpreter-core
    on Jan 10, 2025
  3. added a commit that references this issue on Jun 3, 2025
  4. added 2 commits that reference 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. added a commit that references this issue on Jun 3, 2025
  8. added a commit that references this issue on Jun 3, 2025
  9. encukou commented on Jun 4, 2025

    @encukou
    Member

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

  10. stratakis commented on Jun 4, 2025

    @stratakis
    ContributorAuthor

    Isn't it the same failure as #131038 ?

  11. added
    type-security
    and removed
    type-bug
    on Jun 5, 2025
  12. added a commit that references this issue on Jun 5, 2025
  13. 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.

  14. 9 remaining items

  15. added a commit that references this issue on Jun 10, 2025
  16. added 2 commits that reference this issue on Jun 10, 2025
  17. added a commit that references this issue on Jul 10, 2025
  18. added a commit that references this issue on Jul 12, 2025
  19. added a commit that references this issue on Aug 4, 2025
  20. 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?

  21. added
    pending
    on Aug 15, 2025
  22. 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.

  23. vstinner commented on Aug 16, 2025

    @vstinner
    Member

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

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

    @stratakis
    ContributorAuthor

    Closing this issue as it's superseded by #139808

  27. removed
    pending
    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-coretype-security

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions