|
LLVM 24.0.0git
|
Enumerations | |
| enum class | AuthCheckMethod { None , DummyLoad , HighBitsNoTBI , XPACHint , XPAC } |
| Variants of check performed on an authenticated pointer. More... | |
| enum class | PtrauthCheckMode { Unchecked , Poison , Trap } |
| Ways to check pointer authentication auth/resign failures. More... | |
| enum class | SetRAStateMode { Never , PAuthLR , Always } |
| Control the emission of .cfi_set_ra_state, which replaces the deprecated .cfi_negate_ra_state_with_pc [1]. More... | |
Functions | |
| unsigned | getCheckerSizeInBytes (AuthCheckMethod Method) |
| Returns the number of bytes added by checkAuthenticatedRegister. | |
Variables | |
| constexpr AArch64PACKey::ID | InitFiniKey = AArch64PACKey::IA |
| PAuth key to be used with function pointers in .init_array and .fini_array. | |
| constexpr unsigned | InitFiniPointerConstantDiscriminator = 0xD9D4 |
| Constant discriminator to be used with function pointers in .init_array and .fini_array. | |
|
strong |
Variants of check performed on an authenticated pointer.
In cases such as authenticating the LR value when performing a tail call or when re-signing a signed pointer with a different signing schema, a failed authentication may not generate an exception on its own and may create an authentication or signing oracle if not checked explicitly.
A number of check methods modify control flow in a similar way by rewriting the code
as follows:
| Enumerator | |
|---|---|
| None | Do not check the value at all. |
| DummyLoad | Perform a load to a temporary register. |
| HighBitsNoTBI | Check by comparing bits 62 and 61 of the authenticated address. This method modifies control flow and inserts the following checker: eor Xtmp, Xn, Xn, lsl #1
tbz Xtmp, #62, on_success
|
| XPACHint | Check by comparing the authenticated value with an XPAC-ed one without using PAuth instructions not encoded as HINT. Can only be applied to LR. This method modifies control flow and inserts the following checker: mov Xtmp, LR
xpaclri ; encoded as "hint #7"
; *real* result of authentication.
cmp Xtmp, LR
b.eq on_success
static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C) Definition Value.cpp:484 bool succeeded(LogicalResult Result) Utility function that returns true if the provided LogicalResult corresponds to a success value. Definition LogicalResult.h:67 |
| XPAC | Similar to XPACHint but using Armv8.3-only XPAC instruction, thus not restricted to LR: mov Xtmp, Xn
xpac(i|d) Xn
cmp Xtmp, Xn
b.eq on_success
|
Definition at line 50 of file AArch64PointerAuth.h.
|
strong |
Ways to check pointer authentication auth/resign failures.
| Enumerator | |
|---|---|
| Unchecked | |
| Poison | |
| Trap | |
Definition at line 95 of file AArch64PointerAuth.h.
|
strong |
Control the emission of .cfi_set_ra_state, which replaces the deprecated .cfi_negate_ra_state_with_pc [1].
The latter is fundamentally unable to express some program orders [2], as the dwarf 'program' reads functions in a linear scan of their addresses to reconstruct the state of the frame, whereas control flow may enter and exit such regions arbitrarily (such as in hot-cold-split, and shrinkwrapped fucntions), and thus the negate-based cfi is unable to encode the address of the signing instruciton in all program orders.
Since .cfi_negate_ra_state is still sufficient for describing ptrauth-returns=pauth, we default to using the new CFI only for PAuth_LR, as DW_CFA_AARCH64_negate_ra_state has a smaller encoding than DW_CFA_AARCH64_set_ra_state.
1: https://github.com/ARM-software/abi-aa/pull/346 2: https://github.com/ARM-software/abi-aa/issues/327
| Enumerator | |
|---|---|
| Never | |
| PAuthLR | |
| Always | |
Definition at line 114 of file AArch64PointerAuth.h.
| unsigned llvm::AArch64PAuth::getCheckerSizeInBytes | ( | AuthCheckMethod | Method | ) |
Returns the number of bytes added by checkAuthenticatedRegister.
Definition at line 452 of file AArch64PointerAuth.cpp.
References DummyLoad, HighBitsNoTBI, llvm_unreachable, None, XPAC, and XPACHint.
Referenced by llvm::AArch64InstrInfo::getInstSizeInBytes().
|
constexpr |
PAuth key to be used with function pointers in .init_array and .fini_array.
Definition at line 18 of file AArch64PointerAuth.h.
|
constexpr |
Constant discriminator to be used with function pointers in .init_array and .fini_array.
The value is ptrauth_string_discriminator("init_fini")
Definition at line 22 of file AArch64PointerAuth.h.