blob: 3b4976396ec4ebe1f06dd4c8a9260afa6f689f15 [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);
17void lkdtm_UNALIGNED_LOAD_STORE_WRITE(void);
18void lkdtm_SOFTLOCKUP(void);
19void lkdtm_HARDLOCKUP(void);
20void lkdtm_SPINLOCKUP(void);
21void lkdtm_HUNG_TASK(void);
Kees Cookff86b302017-02-03 15:26:50 -080022void lkdtm_REFCOUNT_SATURATE_INC(void);
23void lkdtm_REFCOUNT_SATURATE_ADD(void);
24void lkdtm_REFCOUNT_ZERO_DEC(void);
25void lkdtm_REFCOUNT_ZERO_INC(void);
26void lkdtm_REFCOUNT_ZERO_SUB(void);
27void lkdtm_REFCOUNT_ZERO_ADD(void);
Kees Cook6819d102016-08-17 14:42:12 -070028void lkdtm_CORRUPT_LIST_ADD(void);
29void lkdtm_CORRUPT_LIST_DEL(void);
Kees Cooke22aa9d2017-03-24 10:51:25 -070030void lkdtm_CORRUPT_USER_DS(void);
Kees Cook00f496c2016-06-26 22:17:25 -070031
Kees Cookffc514f2016-06-26 21:45:23 -070032/* lkdtm_heap.c */
33void lkdtm_OVERWRITE_ALLOCATION(void);
34void lkdtm_WRITE_AFTER_FREE(void);
35void lkdtm_READ_AFTER_FREE(void);
36void lkdtm_WRITE_BUDDY_AFTER_FREE(void);
37void lkdtm_READ_BUDDY_AFTER_FREE(void);
38
Kees Cook0d9eb292016-06-26 15:12:31 -070039/* lkdtm_perms.c */
40void __init lkdtm_perms_init(void);
41void lkdtm_WRITE_RO(void);
42void lkdtm_WRITE_RO_AFTER_INIT(void);
43void lkdtm_WRITE_KERN(void);
44void lkdtm_EXEC_DATA(void);
45void lkdtm_EXEC_STACK(void);
46void lkdtm_EXEC_KMALLOC(void);
47void lkdtm_EXEC_VMALLOC(void);
48void lkdtm_EXEC_RODATA(void);
49void lkdtm_EXEC_USERSPACE(void);
50void lkdtm_ACCESS_USERSPACE(void);
51
Kees Cooka3dff712016-06-26 08:46:23 -070052/* lkdtm_rodata.c */
Kees Cook9a49a522016-02-22 14:09:29 -080053void lkdtm_rodata_do_nothing(void);
54
Kees Cooka3dff712016-06-26 08:46:23 -070055/* lkdtm_usercopy.c */
56void __init lkdtm_usercopy_init(void);
57void __exit lkdtm_usercopy_exit(void);
58void lkdtm_USERCOPY_HEAP_SIZE_TO(void);
59void lkdtm_USERCOPY_HEAP_SIZE_FROM(void);
60void lkdtm_USERCOPY_HEAP_FLAG_TO(void);
61void lkdtm_USERCOPY_HEAP_FLAG_FROM(void);
62void lkdtm_USERCOPY_STACK_FRAME_TO(void);
63void lkdtm_USERCOPY_STACK_FRAME_FROM(void);
64void lkdtm_USERCOPY_STACK_BEYOND(void);
65void lkdtm_USERCOPY_KERNEL(void);
66
Kees Cook9a49a522016-02-22 14:09:29 -080067#endif