[all-commits] [llvm/llvm-project] 68854f: [IR] Define ptrauth intrinsics.

Ahmed Bougacha via All-commits all-commits at lists.llvm.org
Sun Nov 14 08:05:52 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 68854f4e572afec802299e36b2db71dfc4cf2f27
      https://github.com/llvm/llvm-project/commit/68854f4e572afec802299e36b2db71dfc4cf2f27
  Author: Ahmed Bougacha <ahmed at bougacha.org>
  Date:   2021-11-14 (Sun, 14 Nov 2021)

  Changed paths:
    M llvm/docs/LangRef.rst
    A llvm/docs/PointerAuth.md
    M llvm/docs/Reference.rst
    M llvm/include/llvm/IR/Intrinsics.td

  Log Message:
  -----------
  [IR] Define ptrauth intrinsics.

This defines the new `@llvm.ptrauth.` pointer authentication intrinsics:
sign, auth, strip, blend, and sign_generic, documented in PointerAuth.md.

Pointer Authentication is a mechanism by which certain pointers are
signed.  When a pointer gets signed, a cryptographic hash of its value
and other values (pepper and salt) is stored in unused bits of that
pointer.

Before the pointer is used, it needs to be authenticated, i.e., have its
signature checked.  This prevents pointer values of unknown origin from
being used to replace the signed pointer value.

sign and auth provide the core operations.  strip removes the ptrauth
bits from a signed pointer without checking them.  sign_generic allows
signing non-pointer values.  Finally, blend combines salt values
("discriminators") to derive more targeted and less reusable ones.

In later patches, we implement primary backend support for these
intrinsics using the AArch64 PAuth feature, and build on that to
implement the arm64e Darwin ABI and ELF PAuth ABI Extension in clang.

For more details, see the docs page, as well as our llvm-dev RFC:
  http://lists.llvm.org/pipermail/llvm-dev/2019-October/136091.html
or our 2019 Developers' Meeting talk.

Differential Revision: https://reviews.llvm.org/D90868




More information about the All-commits mailing list