[all-commits] [llvm/llvm-project] 34342b: [BOLT] Gadget scanner: account for BRK when search...

Anatoly Trosinenko via All-commits all-commits at lists.llvm.org
Mon May 5 09:49:21 PDT 2025


  Branch: refs/heads/users/atrosinenko/bolt-gs-trap-instruction
  Home:   https://github.com/llvm/llvm-project
  Commit: 34342bca75539d23d3a36c190af9a25d17084df4
      https://github.com/llvm/llvm-project/commit/34342bca75539d23d3a36c190af9a25d17084df4
  Author: Anatoly Trosinenko <atrosinenko at accesssoftek.com>
  Date:   2025-05-05 (Mon, 05 May 2025)

  Changed paths:
    M bolt/include/bolt/Core/MCPlusBuilder.h
    M bolt/lib/Passes/PAuthGadgetScanner.cpp
    M bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
    M bolt/test/binary-analysis/AArch64/gs-pauth-address-checks.s
    M bolt/test/binary-analysis/AArch64/gs-pauth-authentication-oracles.s
    M bolt/test/binary-analysis/AArch64/gs-pauth-signing-oracles.s

  Log Message:
  -----------
  [BOLT] Gadget scanner: account for BRK when searching for auth oracles

An authenticated pointer can be explicitly checked by the compiler via a
sequence of instructions that executes BRK on failure. It is important
to recognize such BRK instruction as checking every register (as it is
expected to immediately trigger an abnormal program termination) to
prevent false positive reports about authentication oracles:

    autia   x2, x3
    autia   x0, x1
    ; neither x0 nor x2 are checked at this point
    eor     x16, x0, x0, lsl #1
    tbz     x16, #62, on_success ; marks x0 as checked
    ; end of BB: for x2 to be checked here, it must be checked in both
    ; successor basic blocks
  on_failure:
    brk     0xc470
  on_success:
    ; x2 is checked
    ldr     x1, [x2] ; marks x2 as checked



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