Skip to content

Add support for indirect branch tracking (IBT) #556

Open

Description

@didickman

On newer Intel x86/64 CPUs and on OpenBSD, CompCert produced binaries will crash due to lack of IBT support. As a quick solution we can append “-z nobtcfi” to clinker_options in configure to disable IBT safeguards. However a preferable solution would be to add support for IBT on this platform. This can be partially solved by outputting “endbr64” after “.cfi_startproc” in backend/Printasmaux.ml. And then all that should be left is solving for jump tables. Thank you.

Activity

  1. xavierleroy commented on Jul 28, 2025

    @xavierleroy
    Contributor

    See #557 for a tentative implementation of IBT.

  2. didickman commented on Jul 28, 2025

    @didickman
    ContributorAuthor

    Works nicely for me in my basic testing with an intel CPU that supports IBT. Responding to the note about x86/32 -- indeed OpenBSD does not implement IBT for legacy 32-bit x86 either. Only 64-bit systems have IBT/BTI. Would be great to merge this pull request when ready. Thanks!

  3. xavierleroy commented on Aug 29, 2025

    @xavierleroy
    Contributor

    I'm late on the next release of CompCert and #557 is not as ready to be merged as I would like. As a temporary measure, I added -z nobtcfi to the linker options on x86 BSD, commit d5dcac4 . I'll restart #557 later.

  4. monniaux commented on Sep 9, 2025

    @monniaux
    Contributor
  5. didickman commented on Sep 9, 2025

    @didickman
    ContributorAuthor

    Extremely interesting project! Thanks for sharing! I will definitely take a look into this. In case of interest I am using CompCert on the industrial use side not for research.

  6. monniaux commented on Sep 9, 2025

    @monniaux
    Contributor

    @didickman We support branch target protection and other countermeasures on AArch64 and x86(-64). Feel free to contact me (email) if interested.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions