xref: /linux/drivers/misc/lkdtm/lkdtm.h (revision b77e0ce62d63a761ffb7f7245a215a49f5921c2f)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LKDTM_H
3 #define __LKDTM_H
4 
5 #define pr_fmt(fmt) "lkdtm: " fmt
6 
7 #include <linux/kernel.h>
8 
9 /* bugs.c */
10 void __init lkdtm_bugs_init(int *recur_param);
11 void lkdtm_PANIC(void);
12 void lkdtm_BUG(void);
13 void lkdtm_WARNING(void);
14 void lkdtm_WARNING_MESSAGE(void);
15 void lkdtm_EXCEPTION(void);
16 void lkdtm_LOOP(void);
17 void lkdtm_EXHAUST_STACK(void);
18 void lkdtm_CORRUPT_STACK(void);
19 void lkdtm_CORRUPT_STACK_STRONG(void);
20 void lkdtm_UNALIGNED_LOAD_STORE_WRITE(void);
21 void lkdtm_SOFTLOCKUP(void);
22 void lkdtm_HARDLOCKUP(void);
23 void lkdtm_SPINLOCKUP(void);
24 void lkdtm_HUNG_TASK(void);
25 void lkdtm_OVERFLOW_SIGNED(void);
26 void lkdtm_OVERFLOW_UNSIGNED(void);
27 void lkdtm_ARRAY_BOUNDS(void);
28 void lkdtm_CORRUPT_LIST_ADD(void);
29 void lkdtm_CORRUPT_LIST_DEL(void);
30 void lkdtm_STACK_GUARD_PAGE_LEADING(void);
31 void lkdtm_STACK_GUARD_PAGE_TRAILING(void);
32 void lkdtm_UNSET_SMEP(void);
33 void lkdtm_DOUBLE_FAULT(void);
34 void lkdtm_CORRUPT_PAC(void);
35 void lkdtm_FORTIFY_OBJECT(void);
36 void lkdtm_FORTIFY_SUBOBJECT(void);
37 
38 /* heap.c */
39 void __init lkdtm_heap_init(void);
40 void __exit lkdtm_heap_exit(void);
41 void lkdtm_OVERWRITE_ALLOCATION(void);
42 void lkdtm_WRITE_AFTER_FREE(void);
43 void lkdtm_READ_AFTER_FREE(void);
44 void lkdtm_WRITE_BUDDY_AFTER_FREE(void);
45 void lkdtm_READ_BUDDY_AFTER_FREE(void);
46 void lkdtm_SLAB_FREE_DOUBLE(void);
47 void lkdtm_SLAB_FREE_CROSS(void);
48 void lkdtm_SLAB_FREE_PAGE(void);
49 
50 /* perms.c */
51 void __init lkdtm_perms_init(void);
52 void lkdtm_WRITE_RO(void);
53 void lkdtm_WRITE_RO_AFTER_INIT(void);
54 void lkdtm_WRITE_KERN(void);
55 void lkdtm_EXEC_DATA(void);
56 void lkdtm_EXEC_STACK(void);
57 void lkdtm_EXEC_KMALLOC(void);
58 void lkdtm_EXEC_VMALLOC(void);
59 void lkdtm_EXEC_RODATA(void);
60 void lkdtm_EXEC_USERSPACE(void);
61 void lkdtm_EXEC_NULL(void);
62 void lkdtm_ACCESS_USERSPACE(void);
63 void lkdtm_ACCESS_NULL(void);
64 
65 /* refcount.c */
66 void lkdtm_REFCOUNT_INC_OVERFLOW(void);
67 void lkdtm_REFCOUNT_ADD_OVERFLOW(void);
68 void lkdtm_REFCOUNT_INC_NOT_ZERO_OVERFLOW(void);
69 void lkdtm_REFCOUNT_ADD_NOT_ZERO_OVERFLOW(void);
70 void lkdtm_REFCOUNT_DEC_ZERO(void);
71 void lkdtm_REFCOUNT_DEC_NEGATIVE(void);
72 void lkdtm_REFCOUNT_DEC_AND_TEST_NEGATIVE(void);
73 void lkdtm_REFCOUNT_SUB_AND_TEST_NEGATIVE(void);
74 void lkdtm_REFCOUNT_INC_ZERO(void);
75 void lkdtm_REFCOUNT_ADD_ZERO(void);
76 void lkdtm_REFCOUNT_INC_SATURATED(void);
77 void lkdtm_REFCOUNT_DEC_SATURATED(void);
78 void lkdtm_REFCOUNT_ADD_SATURATED(void);
79 void lkdtm_REFCOUNT_INC_NOT_ZERO_SATURATED(void);
80 void lkdtm_REFCOUNT_ADD_NOT_ZERO_SATURATED(void);
81 void lkdtm_REFCOUNT_DEC_AND_TEST_SATURATED(void);
82 void lkdtm_REFCOUNT_SUB_AND_TEST_SATURATED(void);
83 void lkdtm_REFCOUNT_TIMING(void);
84 void lkdtm_ATOMIC_TIMING(void);
85 
86 /* rodata.c */
87 void lkdtm_rodata_do_nothing(void);
88 
89 /* usercopy.c */
90 void __init lkdtm_usercopy_init(void);
91 void __exit lkdtm_usercopy_exit(void);
92 void lkdtm_USERCOPY_HEAP_SIZE_TO(void);
93 void lkdtm_USERCOPY_HEAP_SIZE_FROM(void);
94 void lkdtm_USERCOPY_HEAP_WHITELIST_TO(void);
95 void lkdtm_USERCOPY_HEAP_WHITELIST_FROM(void);
96 void lkdtm_USERCOPY_STACK_FRAME_TO(void);
97 void lkdtm_USERCOPY_STACK_FRAME_FROM(void);
98 void lkdtm_USERCOPY_STACK_BEYOND(void);
99 void lkdtm_USERCOPY_KERNEL(void);
100 
101 /* stackleak.c */
102 void lkdtm_STACKLEAK_ERASING(void);
103 
104 /* cfi.c */
105 void lkdtm_CFI_FORWARD_PROTO(void);
106 
107 /* fortify.c */
108 void lkdtm_FORTIFIED_STRSCPY(void);
109 
110 /* powerpc.c */
111 void lkdtm_PPC_SLB_MULTIHIT(void);
112 
113 #endif
114