[clang] 8578b60 - [clang] Add ABI-defined key assignments to ptrauth.h. (#93901)

via cfe-commits cfe-commits at lists.llvm.org
Fri May 31 13:03:34 PDT 2024


Author: Ahmed Bougacha
Date: 2024-05-31T13:03:30-07:00
New Revision: 8578b60758e6a588ec41a9678829cebec471f8e5

URL: https://github.com/llvm/llvm-project/commit/8578b60758e6a588ec41a9678829cebec471f8e5
DIFF: https://github.com/llvm/llvm-project/commit/8578b60758e6a588ec41a9678829cebec471f8e5.diff

LOG: [clang] Add ABI-defined key assignments to ptrauth.h. (#93901)

This is the current key assignment defined by the arm64e architecture
on Darwin platforms, and also matches the intended key assignments
in the initial ELF adopters.  This can be made more generic if needed,
by e.g., defining these in the preprocessor instead.

Added: 
    

Modified: 
    clang/lib/Headers/ptrauth.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Headers/ptrauth.h b/clang/lib/Headers/ptrauth.h
index 56c3c3636c9bc..a9d182aa24470 100644
--- a/clang/lib/Headers/ptrauth.h
+++ b/clang/lib/Headers/ptrauth.h
@@ -15,6 +15,19 @@ typedef enum {
   ptrauth_key_asib = 1,
   ptrauth_key_asda = 2,
   ptrauth_key_asdb = 3,
+
+  /* A process-independent key which can be used to sign code pointers. */
+  ptrauth_key_process_independent_code = ptrauth_key_asia,
+
+  /* A process-specific key which can be used to sign code pointers. */
+  ptrauth_key_process_dependent_code = ptrauth_key_asib,
+
+  /* A process-independent key which can be used to sign data pointers. */
+  ptrauth_key_process_independent_data = ptrauth_key_asda,
+
+  /* A process-specific key which can be used to sign data pointers. */
+  ptrauth_key_process_dependent_data = ptrauth_key_asdb,
+
 } ptrauth_key;
 
 /* An integer type of the appropriate size for a discriminator argument. */


        


More information about the cfe-commits mailing list