blob: 614612325332e3415ea6d64c558da31fa86fe6b4 [file] [log] [blame]
rjw1f884582022-01-06 17:20:42 +08001/* 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/* lkdtm_bugs.c */
10void __init lkdtm_bugs_init(int *recur_param);
11void lkdtm_PANIC(void);
12void lkdtm_BUG(void);
13void lkdtm_WARNING(void);
14void lkdtm_EXCEPTION(void);
15void lkdtm_LOOP(void);
16void lkdtm_OVERFLOW(void);
17void lkdtm_CORRUPT_STACK(void);
18void lkdtm_CORRUPT_STACK_STRONG(void);
19void lkdtm_UNALIGNED_LOAD_STORE_WRITE(void);
20void lkdtm_SOFTLOCKUP(void);
21void lkdtm_HARDLOCKUP(void);
22void lkdtm_SPINLOCKUP(void);
23void lkdtm_HUNG_TASK(void);
24void lkdtm_CORRUPT_LIST_ADD(void);
25void lkdtm_CORRUPT_LIST_DEL(void);
26void lkdtm_CORRUPT_USER_DS(void);
27void lkdtm_STACK_GUARD_PAGE_LEADING(void);
28void lkdtm_STACK_GUARD_PAGE_TRAILING(void);
29
30/* lkdtm_heap.c */
31void lkdtm_OVERWRITE_ALLOCATION(void);
32void lkdtm_WRITE_AFTER_FREE(void);
33void lkdtm_READ_AFTER_FREE(void);
34void lkdtm_WRITE_BUDDY_AFTER_FREE(void);
35void lkdtm_READ_BUDDY_AFTER_FREE(void);
36
37/* lkdtm_perms.c */
38void __init lkdtm_perms_init(void);
39void lkdtm_WRITE_RO(void);
40void lkdtm_WRITE_RO_AFTER_INIT(void);
41void lkdtm_WRITE_KERN(void);
42void lkdtm_EXEC_DATA(void);
43void lkdtm_EXEC_STACK(void);
44void lkdtm_EXEC_KMALLOC(void);
45void lkdtm_EXEC_VMALLOC(void);
46void lkdtm_EXEC_RODATA(void);
47void lkdtm_EXEC_USERSPACE(void);
48void lkdtm_EXEC_NULL(void);
49void lkdtm_ACCESS_USERSPACE(void);
50void lkdtm_ACCESS_NULL(void);
51
52/* lkdtm_refcount.c */
53void lkdtm_REFCOUNT_INC_OVERFLOW(void);
54void lkdtm_REFCOUNT_ADD_OVERFLOW(void);
55void lkdtm_REFCOUNT_INC_NOT_ZERO_OVERFLOW(void);
56void lkdtm_REFCOUNT_ADD_NOT_ZERO_OVERFLOW(void);
57void lkdtm_REFCOUNT_DEC_ZERO(void);
58void lkdtm_REFCOUNT_DEC_NEGATIVE(void);
59void lkdtm_REFCOUNT_DEC_AND_TEST_NEGATIVE(void);
60void lkdtm_REFCOUNT_SUB_AND_TEST_NEGATIVE(void);
61void lkdtm_REFCOUNT_INC_ZERO(void);
62void lkdtm_REFCOUNT_ADD_ZERO(void);
63void lkdtm_REFCOUNT_INC_SATURATED(void);
64void lkdtm_REFCOUNT_DEC_SATURATED(void);
65void lkdtm_REFCOUNT_ADD_SATURATED(void);
66void lkdtm_REFCOUNT_INC_NOT_ZERO_SATURATED(void);
67void lkdtm_REFCOUNT_ADD_NOT_ZERO_SATURATED(void);
68void lkdtm_REFCOUNT_DEC_AND_TEST_SATURATED(void);
69void lkdtm_REFCOUNT_SUB_AND_TEST_SATURATED(void);
70void lkdtm_REFCOUNT_TIMING(void);
71void lkdtm_ATOMIC_TIMING(void);
72
73/* lkdtm_rodata.c */
74void lkdtm_rodata_do_nothing(void);
75
76/* lkdtm_usercopy.c */
77void __init lkdtm_usercopy_init(void);
78void __exit lkdtm_usercopy_exit(void);
79void lkdtm_USERCOPY_HEAP_SIZE_TO(void);
80void lkdtm_USERCOPY_HEAP_SIZE_FROM(void);
81void lkdtm_USERCOPY_HEAP_FLAG_TO(void);
82void lkdtm_USERCOPY_HEAP_FLAG_FROM(void);
83void lkdtm_USERCOPY_STACK_FRAME_TO(void);
84void lkdtm_USERCOPY_STACK_FRAME_FROM(void);
85void lkdtm_USERCOPY_STACK_BEYOND(void);
86void lkdtm_USERCOPY_KERNEL(void);
87
88#endif