~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/evm.h

Version: ~ [ linux-5.8-rc3 ] ~ [ linux-5.7.5 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.48 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.129 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.185 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.228 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.228 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.85 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * evm.h
  4  *
  5  * Copyright (c) 2009 IBM Corporation
  6  * Author: Mimi Zohar <zohar@us.ibm.com>
  7  */
  8 
  9 #ifndef _LINUX_EVM_H
 10 #define _LINUX_EVM_H
 11 
 12 #include <linux/integrity.h>
 13 #include <linux/xattr.h>
 14 
 15 struct integrity_iint_cache;
 16 
 17 #ifdef CONFIG_EVM
 18 extern int evm_set_key(void *key, size_t keylen);
 19 extern enum integrity_status evm_verifyxattr(struct dentry *dentry,
 20                                              const char *xattr_name,
 21                                              void *xattr_value,
 22                                              size_t xattr_value_len,
 23                                              struct integrity_iint_cache *iint);
 24 extern int evm_inode_setattr(struct dentry *dentry, struct iattr *attr);
 25 extern void evm_inode_post_setattr(struct dentry *dentry, int ia_valid);
 26 extern int evm_inode_setxattr(struct dentry *dentry, const char *name,
 27                               const void *value, size_t size);
 28 extern void evm_inode_post_setxattr(struct dentry *dentry,
 29                                     const char *xattr_name,
 30                                     const void *xattr_value,
 31                                     size_t xattr_value_len);
 32 extern int evm_inode_removexattr(struct dentry *dentry, const char *xattr_name);
 33 extern void evm_inode_post_removexattr(struct dentry *dentry,
 34                                        const char *xattr_name);
 35 extern int evm_inode_init_security(struct inode *inode,
 36                                    const struct xattr *xattr_array,
 37                                    struct xattr *evm);
 38 #ifdef CONFIG_FS_POSIX_ACL
 39 extern int posix_xattr_acl(const char *xattrname);
 40 #else
 41 static inline int posix_xattr_acl(const char *xattrname)
 42 {
 43         return 0;
 44 }
 45 #endif
 46 #else
 47 
 48 static inline int evm_set_key(void *key, size_t keylen)
 49 {
 50         return -EOPNOTSUPP;
 51 }
 52 
 53 #ifdef CONFIG_INTEGRITY
 54 static inline enum integrity_status evm_verifyxattr(struct dentry *dentry,
 55                                                     const char *xattr_name,
 56                                                     void *xattr_value,
 57                                                     size_t xattr_value_len,
 58                                         struct integrity_iint_cache *iint)
 59 {
 60         return INTEGRITY_UNKNOWN;
 61 }
 62 #endif
 63 
 64 static inline int evm_inode_setattr(struct dentry *dentry, struct iattr *attr)
 65 {
 66         return 0;
 67 }
 68 
 69 static inline void evm_inode_post_setattr(struct dentry *dentry, int ia_valid)
 70 {
 71         return;
 72 }
 73 
 74 static inline int evm_inode_setxattr(struct dentry *dentry, const char *name,
 75                                      const void *value, size_t size)
 76 {
 77         return 0;
 78 }
 79 
 80 static inline void evm_inode_post_setxattr(struct dentry *dentry,
 81                                            const char *xattr_name,
 82                                            const void *xattr_value,
 83                                            size_t xattr_value_len)
 84 {
 85         return;
 86 }
 87 
 88 static inline int evm_inode_removexattr(struct dentry *dentry,
 89                                         const char *xattr_name)
 90 {
 91         return 0;
 92 }
 93 
 94 static inline void evm_inode_post_removexattr(struct dentry *dentry,
 95                                               const char *xattr_name)
 96 {
 97         return;
 98 }
 99 
100 static inline int evm_inode_init_security(struct inode *inode,
101                                           const struct xattr *xattr_array,
102                                           struct xattr *evm)
103 {
104         return 0;
105 }
106 
107 #endif /* CONFIG_EVM */
108 #endif /* LINUX_EVM_H */
109 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp