]>
Commit | Line | Data |
---|---|---|
cb323159 A |
1 | /* |
2 | * Copyright (c) 2019 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
6 | * The contents of this file constitute Original Code as defined in and | |
7 | * are subject to the Apple Public Source License Version 1.1 (the | |
8 | * "License"). You may not use this file except in compliance with the | |
9 | * License. Please obtain a copy of the License at | |
10 | * http://www.apple.com/publicsource and read it before using this file. | |
11 | * | |
12 | * This Original Code and all software distributed under the License are | |
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, | |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the | |
17 | * License for the specific language governing rights and limitations | |
18 | * under the License. | |
19 | * | |
20 | * @APPLE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | ||
23 | enum ptrauth_key { | |
24 | ptrauth_key_asia = 0, | |
25 | ptrauth_key_asib = 1, | |
26 | ptrauth_key_asda = 2, | |
27 | ptrauth_key_asdb = 3, | |
28 | ||
29 | /* A process-independent key which can be used to sign code pointers. | |
30 | Signing and authenticating with this key is a no-op in processes | |
31 | which disable ABI pointer authentication. */ | |
32 | ptrauth_key_process_independent_code = ptrauth_key_asia, | |
33 | ||
34 | /* A process-specific key which can be used to sign code pointers. | |
35 | Signing and authenticating with this key is enforced even in processes | |
36 | which disable ABI pointer authentication. */ | |
37 | ptrauth_key_process_dependent_code = ptrauth_key_asib, | |
38 | ||
39 | /* A process-independent key which can be used to sign data pointers. | |
40 | Signing and authenticating with this key is a no-op in processes | |
41 | which disable ABI pointer authentication. */ | |
42 | ptrauth_key_process_independent_data = ptrauth_key_asda, | |
43 | ||
44 | /* A process-specific key which can be used to sign data pointers. | |
45 | Signing and authenticating with this key is a no-op in processes | |
46 | which disable ABI pointer authentication. */ | |
47 | ptrauth_key_process_dependent_data = ptrauth_key_asdb, | |
48 | ||
49 | /* The key used to sign C function pointers. | |
50 | The extra data is always 0. */ | |
51 | ptrauth_key_function_pointer = ptrauth_key_process_independent_code, | |
52 | ||
53 | /* The key used to sign return addresses on the stack. | |
54 | The extra data is based on the storage address of the return address. | |
55 | On ARM64, that is always the storage address of the return address plus 8 | |
56 | (or, in other words, the value of the stack pointer on function entry) */ | |
57 | ptrauth_key_return_address = ptrauth_key_process_dependent_code, | |
58 | ||
59 | /* The key used to sign frame pointers on the stack. | |
60 | The extra data is based on the storage address of the frame pointer. | |
61 | On ARM64, that is always the storage address of the frame pointer plus 16 | |
62 | (or, in other words, the value of the stack pointer on function entry) */ | |
63 | ptrauth_key_frame_pointer = ptrauth_key_process_dependent_data, | |
64 | ||
65 | /* The key used to sign block function pointers, including: | |
66 | invocation functions, | |
67 | block object copy functions, | |
68 | block object destroy functions, | |
69 | __block variable copy functions, and | |
70 | __block variable destroy functions. | |
71 | The extra data is always the address at which the function pointer | |
72 | is stored. | |
73 | ||
74 | Note that block object pointers themselves (i.e. the direct | |
75 | representations of values of block-pointer type) are not signed. */ | |
76 | ptrauth_key_block_function = ptrauth_key_asia, | |
77 | ||
78 | /* The key used to sign C++ v-table pointers. | |
79 | The extra data is always 0. */ | |
80 | ptrauth_key_cxx_vtable_pointer = ptrauth_key_asda | |
81 | ||
82 | }; | |
83 |