blob: bfb6c45b6130bddbafec71aa235f2ab04a4f725c [file] [log] [blame]
Kees Cook9a49a522016-02-22 14:09:29 -08001#ifndef __LKDTM_H
2#define __LKDTM_H
3
Kees Cook6d2e91a2016-07-15 16:04:39 -07004#define pr_fmt(fmt) "lkdtm: " fmt
5
6#include <linux/kernel.h>
7
Kees Cook00f496c2016-06-26 22:17:25 -07008/* lkdtm_bugs.c */
9void __init lkdtm_bugs_init(int *recur_param);
10void lkdtm_PANIC(void);
11void lkdtm_BUG(void);
12void lkdtm_WARNING(void);
13void lkdtm_EXCEPTION(void);
14void lkdtm_LOOP(void);
15void lkdtm_OVERFLOW(void);
16void lkdtm_CORRUPT_STACK(void);
Kees Cook93e78c62017-08-04 14:34:40 -070017void lkdtm_CORRUPT_STACK_STRONG(void);
Kees Cook00f496c2016-06-26 22:17:25 -070018void lkdtm_UNALIGNED_LOAD_STORE_WRITE(void);
19void lkdtm_SOFTLOCKUP(void);
20void lkdtm_HARDLOCKUP(void);
21void lkdtm_SPINLOCKUP(void);
22void lkdtm_HUNG_TASK(void);
Kees Cook6819d102016-08-17 14:42:12 -070023void lkdtm_CORRUPT_LIST_ADD(void);
24void lkdtm_CORRUPT_LIST_DEL(void);
Kees Cooke22aa9d2017-03-24 10:51:25 -070025void lkdtm_CORRUPT_USER_DS(void);
Kees Cook7b25a852017-08-04 13:04:21 -070026void lkdtm_STACK_GUARD_PAGE_LEADING(void);
27void lkdtm_STACK_GUARD_PAGE_TRAILING(void);
Kees Cook00f496c2016-06-26 22:17:25 -070028
Kees Cookffc514f2016-06-26 21:45:23 -070029/* lkdtm_heap.c */
30void lkdtm_OVERWRITE_ALLOCATION(void);
31void lkdtm_WRITE_AFTER_FREE(void);
32void lkdtm_READ_AFTER_FREE(void);
33void lkdtm_WRITE_BUDDY_AFTER_FREE(void);
34void lkdtm_READ_BUDDY_AFTER_FREE(void);
35
Kees Cook0d9eb292016-06-26 15:12:31 -070036/* lkdtm_perms.c */
37void __init lkdtm_perms_init(void);
38void lkdtm_WRITE_RO(void);
39void lkdtm_WRITE_RO_AFTER_INIT(void);
40void lkdtm_WRITE_KERN(void);
41void lkdtm_EXEC_DATA(void);
42void lkdtm_EXEC_STACK(void);
43void lkdtm_EXEC_KMALLOC(void);
44void lkdtm_EXEC_VMALLOC(void);
45void lkdtm_EXEC_RODATA(void);
46void lkdtm_EXEC_USERSPACE(void);
47void lkdtm_ACCESS_USERSPACE(void);
48
Kees Cook95925c92017-04-24 13:23:21 -070049/* lkdtm_refcount.c */
50void lkdtm_REFCOUNT_INC_OVERFLOW(void);
51void lkdtm_REFCOUNT_ADD_OVERFLOW(void);
52void lkdtm_REFCOUNT_INC_NOT_ZERO_OVERFLOW(void);
53void lkdtm_REFCOUNT_ADD_NOT_ZERO_OVERFLOW(void);
54void lkdtm_REFCOUNT_DEC_ZERO(void);
55void lkdtm_REFCOUNT_DEC_NEGATIVE(void);
56void lkdtm_REFCOUNT_DEC_AND_TEST_NEGATIVE(void);
57void lkdtm_REFCOUNT_SUB_AND_TEST_NEGATIVE(void);
58void lkdtm_REFCOUNT_INC_ZERO(void);
59void lkdtm_REFCOUNT_ADD_ZERO(void);
60void lkdtm_REFCOUNT_INC_SATURATED(void);
61void lkdtm_REFCOUNT_DEC_SATURATED(void);
62void lkdtm_REFCOUNT_ADD_SATURATED(void);
63void lkdtm_REFCOUNT_INC_NOT_ZERO_SATURATED(void);
64void lkdtm_REFCOUNT_ADD_NOT_ZERO_SATURATED(void);
65void lkdtm_REFCOUNT_DEC_AND_TEST_SATURATED(void);
66void lkdtm_REFCOUNT_SUB_AND_TEST_SATURATED(void);
Kees Cookc7fea482017-07-21 06:19:14 -070067void lkdtm_REFCOUNT_TIMING(void);
68void lkdtm_ATOMIC_TIMING(void);
Kees Cook95925c92017-04-24 13:23:21 -070069
Kees Cooka3dff712016-06-26 08:46:23 -070070/* lkdtm_rodata.c */
Kees Cook9a49a522016-02-22 14:09:29 -080071void lkdtm_rodata_do_nothing(void);
72
Kees Cooka3dff712016-06-26 08:46:23 -070073/* lkdtm_usercopy.c */
74void __init lkdtm_usercopy_init(void);
75void __exit lkdtm_usercopy_exit(void);
76void lkdtm_USERCOPY_HEAP_SIZE_TO(void);
77void lkdtm_USERCOPY_HEAP_SIZE_FROM(void);
78void lkdtm_USERCOPY_HEAP_FLAG_TO(void);
79void lkdtm_USERCOPY_HEAP_FLAG_FROM(void);
80void lkdtm_USERCOPY_STACK_FRAME_TO(void);
81void lkdtm_USERCOPY_STACK_FRAME_FROM(void);
82void lkdtm_USERCOPY_STACK_BEYOND(void);
83void lkdtm_USERCOPY_KERNEL(void);
84
Kees Cook9a49a522016-02-22 14:09:29 -080085#endif