Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (C) 2009 IBM Corporation
0004  * Author: Mimi Zohar <zohar@us.ibm.com>
0005  */
0006 
0007 #ifndef _LINUX_INTEGRITY_H
0008 #define _LINUX_INTEGRITY_H
0009 
0010 #include <linux/fs.h>
0011 
0012 enum integrity_status {
0013     INTEGRITY_PASS = 0,
0014     INTEGRITY_PASS_IMMUTABLE,
0015     INTEGRITY_FAIL,
0016     INTEGRITY_FAIL_IMMUTABLE,
0017     INTEGRITY_NOLABEL,
0018     INTEGRITY_NOXATTRS,
0019     INTEGRITY_UNKNOWN,
0020 };
0021 
0022 /* List of EVM protected security xattrs */
0023 #ifdef CONFIG_INTEGRITY
0024 extern struct integrity_iint_cache *integrity_inode_get(struct inode *inode);
0025 extern void integrity_inode_free(struct inode *inode);
0026 extern void __init integrity_load_keys(void);
0027 
0028 #else
0029 static inline struct integrity_iint_cache *
0030                 integrity_inode_get(struct inode *inode)
0031 {
0032     return NULL;
0033 }
0034 
0035 static inline void integrity_inode_free(struct inode *inode)
0036 {
0037     return;
0038 }
0039 
0040 static inline void integrity_load_keys(void)
0041 {
0042 }
0043 #endif /* CONFIG_INTEGRITY */
0044 
0045 #ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS
0046 
0047 extern int integrity_kernel_module_request(char *kmod_name);
0048 
0049 #else
0050 
0051 static inline int integrity_kernel_module_request(char *kmod_name)
0052 {
0053     return 0;
0054 }
0055 
0056 #endif /* CONFIG_INTEGRITY_ASYMMETRIC_KEYS */
0057 
0058 #endif /* _LINUX_INTEGRITY_H */