]>
Commit | Line | Data |
---|---|---|
b886d83c | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
f381c272 MZ |
2 | /* |
3 | * Copyright (C) 2009 IBM Corporation | |
4 | * Author: Mimi Zohar <zohar@us.ibm.com> | |
f381c272 MZ |
5 | */ |
6 | ||
7 | #ifndef _LINUX_INTEGRITY_H | |
8 | #define _LINUX_INTEGRITY_H | |
9 | ||
10 | #include <linux/fs.h> | |
11 | ||
66dbc325 MZ |
12 | enum integrity_status { |
13 | INTEGRITY_PASS = 0, | |
50b97748 | 14 | INTEGRITY_PASS_IMMUTABLE, |
66dbc325 | 15 | INTEGRITY_FAIL, |
cdef685b | 16 | INTEGRITY_FAIL_IMMUTABLE, |
66dbc325 | 17 | INTEGRITY_NOLABEL, |
566be59a | 18 | INTEGRITY_NOXATTRS, |
66dbc325 MZ |
19 | INTEGRITY_UNKNOWN, |
20 | }; | |
21 | ||
6be5cc52 | 22 | /* List of EVM protected security xattrs */ |
f381c272 | 23 | #ifdef CONFIG_INTEGRITY |
bf2276d1 | 24 | extern struct integrity_iint_cache *integrity_inode_get(struct inode *inode); |
f381c272 | 25 | extern void integrity_inode_free(struct inode *inode); |
c9cd2ce2 | 26 | extern void __init integrity_load_keys(void); |
f381c272 MZ |
27 | |
28 | #else | |
bf2276d1 DK |
29 | static inline struct integrity_iint_cache * |
30 | integrity_inode_get(struct inode *inode) | |
f381c272 | 31 | { |
bf2276d1 | 32 | return NULL; |
f381c272 MZ |
33 | } |
34 | ||
35 | static inline void integrity_inode_free(struct inode *inode) | |
36 | { | |
37 | return; | |
38 | } | |
c9cd2ce2 DK |
39 | |
40 | static inline void integrity_load_keys(void) | |
41 | { | |
42 | } | |
e05a4f4f | 43 | #endif /* CONFIG_INTEGRITY */ |
c9cd2ce2 | 44 | |
6eb864c1 MK |
45 | #ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS |
46 | ||
47 | extern int integrity_kernel_module_request(char *kmod_name); | |
48 | ||
49 | #else | |
50 | ||
51 | static inline int integrity_kernel_module_request(char *kmod_name) | |
52 | { | |
53 | return 0; | |
54 | } | |
55 | ||
56 | #endif /* CONFIG_INTEGRITY_ASYMMETRIC_KEYS */ | |
57 | ||
f381c272 | 58 | #endif /* _LINUX_INTEGRITY_H */ |