[Dwarf] Support `__ptrauth` qualifier in metadata nodes (#83862)
Reland #82363 after fixing build failure
https://lab.llvm.org/buildbot/#/builders/5/builds/41428.
Memory sanitizer detects usage of `RawData` union member which is not
filled directly. Instead, the code relies on filling `Data` union
member, which is a struct consisting of signing schema parameters.
According to https://en.cppreference.com/w/cpp/language/union, this is
UB:
"It is undefined behavior to read from the member of the union that
wasn't most recently written".
Instead of relying on compiler allowing us to do dirty things, do not
use union and only store `RawData`. Particular ptrauth parameters are
obtained on demand via bit operations.
Original PR description below.
[12 lines not shown]
[IR][AArch64] Add "ptrauth(...)" Constant to represent signed pointers.
This defines a new kind of IR Constant that represents a ptrauth
signed pointer, as used in AArch64 PAuth.
It allows representing most kinds of signed pointer constants
used thus far in the llvm ptrauth implementations, notably those
used in the Darwin and ELF ABIs being implemented for c/c++.
These signed pointer constants are then lowered to ELF/MachO
relocations.
These can be simply thought of as a constant `llvm.ptrauth.sign`,
with the interesting addition of discriminator computation:
the `ptrauth` constant can also represent a combined blend,
when both address and integer discriminator operands are used.
Co-Authored-by: Tim Northover <tnorthover at apple.com>
[AArch64][PAC] Don't emit auth/resign checks when targeting FPAC.
When the FPAC feature is present, we can rely on its faulting
behavior to avoid emitting the expensive authentication failure
check sequence ourvelves. In which case we emit the same
sequence as a plain unchecked auth/resign.
[AArch64][PAC] Lower auth/resign into checked sequence.
This introduces 3 hardening modes in the authentication step of
auth/resign lowering:
- unchecked, which uses the AUT instructions as-is
- poison, which detects authentication failure (using an XPAC+CMP
sequence), explicitly yielding the XPAC result rather than the
AUT result, to avoid leaking
- trap, which additionally traps on authentication failure,
using BRK #0xC470 + key (IA C470, IB C471, DA C472, DB C473.)
Not all modes are necessarily useful in all contexts, and there
are more performant alternative lowerings in specific contexts
(e.g., when I/D TBI enablement is a target ABI guarantee.)
This is controlled by the `ptrauth-auth-traps` function attributes,
and can be overridden using `-aarch64-ptrauth-auth-checks=`.
Rename parent to issuer in struct auth
Parent is confusing and issuer is the appropriate terminology. This is
a mechanical diff. The only remaining uses of 'parent' in this code
base now mean 'parent process'.
discussed with beck and job
ok job
[GlobalMerge] Use vector::assign in place of fill+resize. NFC (#85723)
Noticed while reviewing the code.
If the resize causes a new allocation, this will fill the new allocation
with zeroes directly. Previously, we would fill the old allocation with
zeroes, then copy them to the new allocation before filling the
additional space with zeros.
count if_enqueue/ifq_enqueue errors as oqdrops.
this helps narrow down where some "output failures" on sec interfaces
occur.
based on discussion with jason tubnor
[mlir][sparse] Fix memory leaks (part 4)
This commit fixes memory leaks in sparse tensor integration tests by
adding `bufferization.dealloc_tensor` ops.
Note: Buffer deallocation will be automated in the future with the
ownership-based buffer deallocation pass, making `dealloc_tensor`
obsolete (only codegen path, not when using the runtime library).
This commit fixes the remaining memory leaks in the MLIR test suite.
`check-mlir` now passes when built with ASAN.
[flang][cuda] Handle lowering of stars in cuf kernel launch parameters (#85695)
Parsing of the cuf kernel loop directive has been updated to handle
variants with the * syntax. This patch updates the lowering to make use
of them.
- If the grid or block syntax uses only stars then the operation
variadic operand remains empty.
- If there is values and stars, then stars are represented as a zero
constant value.
[NFC] Disable llvm-objdump test on AIX
After commit 9d5edfde5c3dbc4eb559d316e82e664f291fc2bf the test is failing on the AIX bot. XFAIL for now to unblock the bot and give time to investigate.