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