Skip to content

Commit fc8f76b

Browse files
committed
[clang] Add arm64e ABI-defined key assignments to ptrauth.h.
These are currently gated by __APPLE__; we can figure out a way to define these on ELF targets as well, and maybe have them be defined by clang itself, depending on ABI modes.
1 parent 3613b26 commit fc8f76b

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

clang/lib/Headers/ptrauth.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,29 @@ typedef enum {
1515
ptrauth_key_asib = 1,
1616
ptrauth_key_asda = 2,
1717
ptrauth_key_asdb = 3,
18+
19+
#ifdef __APPLE__
20+
/* A process-independent key which can be used to sign code pointers.
21+
Signing and authenticating with this key is a no-op in processes
22+
which disable ABI pointer authentication. */
23+
ptrauth_key_process_independent_code = ptrauth_key_asia,
24+
25+
/* A process-specific key which can be used to sign code pointers.
26+
Signing and authenticating with this key is enforced even in processes
27+
which disable ABI pointer authentication. */
28+
ptrauth_key_process_dependent_code = ptrauth_key_asib,
29+
30+
/* A process-independent key which can be used to sign data pointers.
31+
Signing and authenticating with this key is a no-op in processes
32+
which disable ABI pointer authentication. */
33+
ptrauth_key_process_independent_data = ptrauth_key_asda,
34+
35+
/* A process-specific key which can be used to sign data pointers.
36+
Signing and authenticating with this key is a no-op in processes
37+
which disable ABI pointer authentication. */
38+
ptrauth_key_process_dependent_data = ptrauth_key_asdb,
39+
#endif /* __APPLE__ */
40+
1841
} ptrauth_key;
1942

2043
/* An integer type of the appropriate size for a discriminator argument. */

0 commit comments

Comments
 (0)