Kees Cook | 9a49a52 | 2016-02-22 14:09:29 -0800 | [diff] [blame] | 1 | #ifndef __LKDTM_H |
| 2 | #define __LKDTM_H |
| 3 | |
Kees Cook | 6d2e91a | 2016-07-15 16:04:39 -0700 | [diff] [blame] | 4 | #define pr_fmt(fmt) "lkdtm: " fmt |
| 5 | |
| 6 | #include <linux/kernel.h> |
| 7 | |
Kees Cook | 00f496c | 2016-06-26 22:17:25 -0700 | [diff] [blame] | 8 | /* lkdtm_bugs.c */ |
| 9 | void __init lkdtm_bugs_init(int *recur_param); |
| 10 | void lkdtm_PANIC(void); |
| 11 | void lkdtm_BUG(void); |
| 12 | void lkdtm_WARNING(void); |
| 13 | void lkdtm_EXCEPTION(void); |
| 14 | void lkdtm_LOOP(void); |
| 15 | void lkdtm_OVERFLOW(void); |
| 16 | void lkdtm_CORRUPT_STACK(void); |
Kees Cook | 93e78c6 | 2017-08-04 14:34:40 -0700 | [diff] [blame] | 17 | void lkdtm_CORRUPT_STACK_STRONG(void); |
Kees Cook | 00f496c | 2016-06-26 22:17:25 -0700 | [diff] [blame] | 18 | void lkdtm_UNALIGNED_LOAD_STORE_WRITE(void); |
| 19 | void lkdtm_SOFTLOCKUP(void); |
| 20 | void lkdtm_HARDLOCKUP(void); |
| 21 | void lkdtm_SPINLOCKUP(void); |
| 22 | void lkdtm_HUNG_TASK(void); |
Kees Cook | 6819d10 | 2016-08-17 14:42:12 -0700 | [diff] [blame] | 23 | void lkdtm_CORRUPT_LIST_ADD(void); |
| 24 | void lkdtm_CORRUPT_LIST_DEL(void); |
Kees Cook | e22aa9d | 2017-03-24 10:51:25 -0700 | [diff] [blame] | 25 | void lkdtm_CORRUPT_USER_DS(void); |
Kees Cook | 7b25a85 | 2017-08-04 13:04:21 -0700 | [diff] [blame] | 26 | void lkdtm_STACK_GUARD_PAGE_LEADING(void); |
| 27 | void lkdtm_STACK_GUARD_PAGE_TRAILING(void); |
Kees Cook | 00f496c | 2016-06-26 22:17:25 -0700 | [diff] [blame] | 28 | |
Kees Cook | ffc514f | 2016-06-26 21:45:23 -0700 | [diff] [blame] | 29 | /* lkdtm_heap.c */ |
| 30 | void lkdtm_OVERWRITE_ALLOCATION(void); |
| 31 | void lkdtm_WRITE_AFTER_FREE(void); |
| 32 | void lkdtm_READ_AFTER_FREE(void); |
| 33 | void lkdtm_WRITE_BUDDY_AFTER_FREE(void); |
| 34 | void lkdtm_READ_BUDDY_AFTER_FREE(void); |
| 35 | |
Kees Cook | 0d9eb29 | 2016-06-26 15:12:31 -0700 | [diff] [blame] | 36 | /* lkdtm_perms.c */ |
| 37 | void __init lkdtm_perms_init(void); |
| 38 | void lkdtm_WRITE_RO(void); |
| 39 | void lkdtm_WRITE_RO_AFTER_INIT(void); |
| 40 | void lkdtm_WRITE_KERN(void); |
| 41 | void lkdtm_EXEC_DATA(void); |
| 42 | void lkdtm_EXEC_STACK(void); |
| 43 | void lkdtm_EXEC_KMALLOC(void); |
| 44 | void lkdtm_EXEC_VMALLOC(void); |
| 45 | void lkdtm_EXEC_RODATA(void); |
| 46 | void lkdtm_EXEC_USERSPACE(void); |
| 47 | void lkdtm_ACCESS_USERSPACE(void); |
| 48 | |
Kees Cook | 95925c9 | 2017-04-24 13:23:21 -0700 | [diff] [blame] | 49 | /* lkdtm_refcount.c */ |
| 50 | void lkdtm_REFCOUNT_INC_OVERFLOW(void); |
| 51 | void lkdtm_REFCOUNT_ADD_OVERFLOW(void); |
| 52 | void lkdtm_REFCOUNT_INC_NOT_ZERO_OVERFLOW(void); |
| 53 | void lkdtm_REFCOUNT_ADD_NOT_ZERO_OVERFLOW(void); |
| 54 | void lkdtm_REFCOUNT_DEC_ZERO(void); |
| 55 | void lkdtm_REFCOUNT_DEC_NEGATIVE(void); |
| 56 | void lkdtm_REFCOUNT_DEC_AND_TEST_NEGATIVE(void); |
| 57 | void lkdtm_REFCOUNT_SUB_AND_TEST_NEGATIVE(void); |
| 58 | void lkdtm_REFCOUNT_INC_ZERO(void); |
| 59 | void lkdtm_REFCOUNT_ADD_ZERO(void); |
| 60 | void lkdtm_REFCOUNT_INC_SATURATED(void); |
| 61 | void lkdtm_REFCOUNT_DEC_SATURATED(void); |
| 62 | void lkdtm_REFCOUNT_ADD_SATURATED(void); |
| 63 | void lkdtm_REFCOUNT_INC_NOT_ZERO_SATURATED(void); |
| 64 | void lkdtm_REFCOUNT_ADD_NOT_ZERO_SATURATED(void); |
| 65 | void lkdtm_REFCOUNT_DEC_AND_TEST_SATURATED(void); |
| 66 | void lkdtm_REFCOUNT_SUB_AND_TEST_SATURATED(void); |
Kees Cook | c7fea48 | 2017-07-21 06:19:14 -0700 | [diff] [blame] | 67 | void lkdtm_REFCOUNT_TIMING(void); |
| 68 | void lkdtm_ATOMIC_TIMING(void); |
Kees Cook | 95925c9 | 2017-04-24 13:23:21 -0700 | [diff] [blame] | 69 | |
Kees Cook | a3dff71 | 2016-06-26 08:46:23 -0700 | [diff] [blame] | 70 | /* lkdtm_rodata.c */ |
Kees Cook | 9a49a52 | 2016-02-22 14:09:29 -0800 | [diff] [blame] | 71 | void lkdtm_rodata_do_nothing(void); |
| 72 | |
Kees Cook | a3dff71 | 2016-06-26 08:46:23 -0700 | [diff] [blame] | 73 | /* lkdtm_usercopy.c */ |
| 74 | void __init lkdtm_usercopy_init(void); |
| 75 | void __exit lkdtm_usercopy_exit(void); |
| 76 | void lkdtm_USERCOPY_HEAP_SIZE_TO(void); |
| 77 | void lkdtm_USERCOPY_HEAP_SIZE_FROM(void); |
| 78 | void lkdtm_USERCOPY_HEAP_FLAG_TO(void); |
| 79 | void lkdtm_USERCOPY_HEAP_FLAG_FROM(void); |
| 80 | void lkdtm_USERCOPY_STACK_FRAME_TO(void); |
| 81 | void lkdtm_USERCOPY_STACK_FRAME_FROM(void); |
| 82 | void lkdtm_USERCOPY_STACK_BEYOND(void); |
| 83 | void lkdtm_USERCOPY_KERNEL(void); |
| 84 | |
Kees Cook | 9a49a52 | 2016-02-22 14:09:29 -0800 | [diff] [blame] | 85 | #endif |