[all-commits] [llvm/llvm-project] a4a981: [BOLT] Gadget scanner: prevent false positives due...

Anatoly Trosinenko via All-commits all-commits at lists.llvm.org
Thu Sep 17 03:28:13 PDT 2026


  Branch: refs/heads/users/atrosinenko/bolt-gs-safe-jump-tables
  Home:   https://github.com/llvm/llvm-project
  Commit: a4a981abef74719a90412cd119e1792982bb1a7c
      https://github.com/llvm/llvm-project/commit/a4a981abef74719a90412cd119e1792982bb1a7c
  Author: Anatoly Trosinenko <atrosinenko at accesssoftek.com>
  Date:   2026-09-16 (Wed, 16 Sep 2026)

  Changed paths:
    M bolt/include/bolt/Core/MCInstUtils.h
    M bolt/include/bolt/Core/MCPlusBuilder.h
    M bolt/lib/Core/MCInstUtils.cpp
    M bolt/lib/Passes/PAuthGadgetScanner.cpp
    M bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
    A bolt/test/binary-analysis/AArch64/gs-pauth-jump-table.s

  Log Message:
  -----------
  [BOLT] Gadget scanner: prevent false positives due to jump tables

As part of PAuth hardening, AArch64 LLVM backend can use a special
BR_JumpTable pseudo (enabled by -faarch64-jump-table-hardening
Clang option) which is expanded in the AsmPrinter into a contiguous
sequence without unsafe instructions in the middle.

This commit adds another target-specific callback to MCPlusBuilder
to make it possible to inhibit false positives for known-safe jump
table dispatch sequences. Without special handling, the branch
instruction is likely to be reported as a non-protected call (as its
destination is not produced by an auth instruction, PC-relative address
materialization, etc.) and possibly as a tail call being performed with
unsafe link register (as the detection whether the branch instruction
is a tail call is an heuristic).

For now, only the specific instruction sequence used by the AArch64
LLVM backend is matched.


  Commit: ab95265f4b23f229d28ec58fa8464b695d47c7fd
      https://github.com/llvm/llvm-project/commit/ab95265f4b23f229d28ec58fa8464b695d47c7fd
  Author: Anatoly Trosinenko <atrosinenko at accesssoftek.com>
  Date:   2026-09-16 (Wed, 16 Sep 2026)

  Changed paths:
    M bolt/include/bolt/Core/MCInstUtils.h
    M bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
    M bolt/test/binary-analysis/AArch64/gs-pauth-jump-table.s

  Log Message:
  -----------
  Validate jump table bounds, refactor test cases


Compare: https://github.com/llvm/llvm-project/compare/a4a981abef74%5E...ab95265f4b23

To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list