| 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* |
| 3 | * Copyright (C) 2009 IBM Corporation |
| 4 | * Author: Mimi Zohar <zohar@us.ibm.com> |
| 5 | */ |
| 6 | |
| 7 | #ifndef _LINUX_INTEGRITY_H |
| 8 | #define _LINUX_INTEGRITY_H |
| 9 | |
| 10 | #include <linux/fs.h> |
| 11 | |
| 12 | enum integrity_status { |
| 13 | INTEGRITY_PASS = 0, |
| 14 | INTEGRITY_PASS_IMMUTABLE, |
| 15 | INTEGRITY_FAIL, |
| 16 | INTEGRITY_FAIL_IMMUTABLE, |
| 17 | INTEGRITY_NOLABEL, |
| 18 | INTEGRITY_NOXATTRS, |
| 19 | INTEGRITY_UNKNOWN, |
| 20 | }; |
| 21 | |
| 22 | /* List of EVM protected security xattrs */ |
| 23 | #ifdef CONFIG_INTEGRITY |
| 24 | extern struct integrity_iint_cache *integrity_inode_get(struct inode *inode); |
| 25 | extern void integrity_inode_free(struct inode *inode); |
| 26 | extern void __init integrity_load_keys(void); |
| 27 | |
| 28 | #else |
| 29 | static inline struct integrity_iint_cache * |
| 30 | integrity_inode_get(struct inode *inode) |
| 31 | { |
| 32 | return NULL; |
| 33 | } |
| 34 | |
| 35 | static inline void integrity_inode_free(struct inode *inode) |
| 36 | { |
| 37 | return; |
| 38 | } |
| 39 | |
| 40 | static inline void integrity_load_keys(void) |
| 41 | { |
| 42 | } |
| 43 | #endif /* CONFIG_INTEGRITY */ |
| 44 | |
| 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 | |
| 58 | #endif /* _LINUX_INTEGRITY_H */ |