[all-commits] [llvm/llvm-project] cc548e: [AArch64][PAC] Lower authenticated calls with ptra...

Ahmed Bougacha via All-commits all-commits at lists.llvm.org
Fri May 31 14:08:31 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cc548ec47c05971a67ed9ec7086d414aabcf8b05
      https://github.com/llvm/llvm-project/commit/cc548ec47c05971a67ed9ec7086d414aabcf8b05
  Author: Ahmed Bougacha <ahmed at bougacha.org>
  Date:   2024-05-31 (Fri, 31 May 2024)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/CallLowering.h
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
    M llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
    M llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
    M llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.h
    M llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
    M llvm/lib/Target/AArch64/AArch64InstrInfo.td
    M llvm/lib/Target/AArch64/AArch64RegisterInfo.td
    M llvm/lib/Target/AArch64/GISel/AArch64CallLowering.cpp
    M llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.cpp
    M llvm/lib/Target/AArch64/GISel/AArch64GlobalISelUtils.h
    M llvm/test/CodeGen/AArch64/branch-target-enforcement-indirect-calls.ll
    A llvm/test/CodeGen/AArch64/ptrauth-bti-call.ll
    A llvm/test/CodeGen/AArch64/ptrauth-call-rv-marker.ll
    A llvm/test/CodeGen/AArch64/ptrauth-call.ll
    A llvm/test/CodeGen/AArch64/ptrauth-invoke.ll

  Log Message:
  -----------
  [AArch64][PAC] Lower authenticated calls with ptrauth bundles. (#85736)

This adds codegen support for the "ptrauth" operand bundles, which can
be used to augment indirect calls with the equivalent of an
`@llvm.ptrauth.auth` intrinsic call on the call target (possibly
preceded by an `@llvm.ptrauth.blend` on the auth discriminator if
applicable.)

This allows the generation of combined authenticating calls
on AArch64 (in the BLRA* PAuth instructions), while avoiding
the raw just-authenticated function pointer from being
exposed to attackers.

This is done by threading a PtrAuthInfo descriptor through
the call lowering infrastructure, eventually selecting a BLRA
pseudo.  The pseudo encapsulates the safe discriminator
computation, which together with the real BLRA* call get emitted
in late pseudo expansion in AsmPrinter.

Note that this also applies to the other forms of indirect calls,
notably invokes, rvmarker, and tail calls.  Tail-calls in particular
bring some additional complexity, with the intersecting register
constraints of BTI and PAC discriminator computation.
However this doesn't currently support PAuth_LR tail-call variants.

This also adopts an x8+ allocation order for GPR64noip, matching
GPR64.



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