1
2
3
4
5
6
7#ifndef _LINUX_CFI_H
8#define _LINUX_CFI_H
9
10#ifdef CONFIG_CFI_CLANG
11typedef void (*cfi_check_fn)(uint64_t id, void *ptr, void *diag);
12
13
14extern void __cfi_check(uint64_t id, void *ptr, void *diag);
15
16
17
18
19
20#define __CFI_ADDRESSABLE(fn, __attr) \
21 const void *__cfi_jt_ ## fn __visible __attr = (void *)&fn
22
23#ifdef CONFIG_CFI_CLANG_SHADOW
24
25extern void cfi_module_add(struct module *mod, unsigned long base_addr);
26extern void cfi_module_remove(struct module *mod, unsigned long base_addr);
27
28#else
29
30static inline void cfi_module_add(struct module *mod, unsigned long base_addr) {}
31static inline void cfi_module_remove(struct module *mod, unsigned long base_addr) {}
32
33#endif
34
35#else
36
37#define __CFI_ADDRESSABLE(fn, __attr)
38
39#endif
40
41#endif
42