OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. |
| 5 */ |
| 6 |
| 7 /* |
| 8 * Minimal ARM sandbox constants. |
| 9 * |
| 10 * These constants are used in C code as well as assembly, hence the use of |
| 11 * the preprocessor. |
| 12 */ |
| 13 |
| 14 #ifndef NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ |
| 15 #define NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ 1 |
| 16 |
| 17 /* |
| 18 * Specially chosen BKPT and UDF instructions that also correspond to |
| 19 * BKPT and UDF when decoded as Thumb instructions. |
| 20 * All other BKPT/UDF values are disallowed by the validator out of paranoia. |
| 21 */ |
| 22 |
| 23 /* |
| 24 * BKPT #0x5BE0: literal pool head. |
| 25 * |
| 26 * Treated as a roadblock by the validator: all words that follow it in |
| 27 * a bundle aren't validated and can't be branched to. |
| 28 */ |
| 29 #define NACL_INSTR_LITERAL_POOL_HEAD 0xE125BE70 |
| 30 |
| 31 /* |
| 32 * NACL_INSTR_BREAKPOINT, NACL_INSTR_HALT_FILL and NACL_INSTR_ABORT_NOW |
| 33 * are intended to be equivalent from a security point of view. We |
| 34 * provide the distinction between them just for debugging |
| 35 * purposes. They might also generate different POSIX signals. In |
| 36 * principle it should be safe for a debugger to skip past one of these |
| 37 * (unlike NACL_INSTR_POOL_HEAD), because the validator validates the |
| 38 * instructions that follow. |
| 39 */ |
| 40 |
| 41 /* |
| 42 * BKPT #0x5BEF: generic breakpoint. |
| 43 * |
| 44 * Usable statically by users or dynamically by the runtime. |
| 45 */ |
| 46 #define NACL_INSTR_BREAKPOINT 0xE125BE7F |
| 47 |
| 48 /* |
| 49 * UDF #0xEDEF: halt-fill. |
| 50 * |
| 51 * Generated at load time. |
| 52 */ |
| 53 #define NACL_INSTR_HALT_FILL 0xE7FEDEFF |
| 54 |
| 55 /* |
| 56 * UDF #0xEDE0: abort-now. |
| 57 * |
| 58 * Required by some language constructs such as __builtin_trap. |
| 59 */ |
| 60 #define NACL_INSTR_ABORT_NOW 0xE7FEDEF0 |
| 61 |
| 62 /* |
| 63 * UDF #0xEDE1: always fail validation. |
| 64 * |
| 65 * It's guaranteed to always fail, and can be used to initialize buffers |
| 66 * that are expected to be filled later. |
| 67 */ |
| 68 #define NACL_INSTR_FAIL_VALIDATION 0xE7FEDEF1 |
| 69 |
| 70 #endif /* NATIVE_CLIENT_SRC_INCLUDE_ARM_SANDBOX_H_ */ |
OLD | NEW |