[PATCH] D101920: [AArch64][v8.3A] Avoid inserting implicit landing pads (PACI*SP)

Pablo Barrio via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 5 09:26:51 PDT 2021


pbarrio created this revision.
pbarrio added reviewers: kcc, pcc, enh, tamas.petz, danielkiss, psmith, chill.
Herald added subscribers: hiraditya, kristof.beyls.
pbarrio requested review of this revision.
Herald added a project: LLVM.

PACI*SP have the advantage that they are in HINT space, meaning
they can be run successfully in hardware without PAuth support -
they will just behave as a NOP. However, PACI*SP are also implicit
landing pads (think of an extra BTI jc). Therefore, they allow
indirect jumps of all kinds into them, potentially inserting new
gadgets. This patch replaces PACI*SP by PACI* LR, SP when
compiling explicitly for hardware with full PAuth support. PACI*
is not in the HINT space, therefore it will fault when run in
hardware without PAuth support, but it is also not a landing pad,
making programs safer in newer HW.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D101920

Files:
  llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
  llvm/test/CodeGen/AArch64/aarch64-signedreturnaddress.ll
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.ll
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-subtarget.ll
  llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-v8-3.ll
  llvm/test/CodeGen/AArch64/pacbti-llvm-generated-funcs-2.ll
  llvm/test/CodeGen/AArch64/pacbti-module-attrs.ll
  llvm/test/CodeGen/AArch64/sign-return-address-cfi-negate-ra-state.ll
  llvm/test/CodeGen/AArch64/sign-return-address.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D101920.343085.patch
Type: text/x-patch
Size: 12139 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210505/0f4e8efb/attachment.bin>


More information about the llvm-commits mailing list