]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - include/linux/evm.h
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[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
MZ
16#ifdef CONFIG_EVM
17extern enum integrity_status evm_verifyxattr(struct dentry *dentry,
18 const char *xattr_name,
19 void *xattr_value,
2960e6cb
DK
20 size_t xattr_value_len,
21 struct integrity_iint_cache *iint);
817b54aa 22extern int evm_inode_setattr(struct dentry *dentry, struct iattr *attr);
975d2943 23extern void evm_inode_post_setattr(struct dentry *dentry, int ia_valid);
3e1be52d
MZ
24extern int evm_inode_setxattr(struct dentry *dentry, const char *name,
25 const void *value, size_t size);
26extern void evm_inode_post_setxattr(struct dentry *dentry,
27 const char *xattr_name,
28 const void *xattr_value,
29 size_t xattr_value_len);
30extern int evm_inode_removexattr(struct dentry *dentry, const char *xattr_name);
c7b87de2
MZ
31extern void evm_inode_post_removexattr(struct dentry *dentry,
32 const char *xattr_name);
cb723180
MZ
33extern int evm_inode_init_security(struct inode *inode,
34 const struct xattr *xattr_array,
35 struct xattr *evm);
bf6d0f5d
MZ
36#ifdef CONFIG_FS_POSIX_ACL
37extern int posix_xattr_acl(const char *xattrname);
38#else
39static inline int posix_xattr_acl(const char *xattrname)
40{
41 return 0;
42}
43#endif
3e1be52d
MZ
44#else
45#ifdef CONFIG_INTEGRITY
46static inline enum integrity_status evm_verifyxattr(struct dentry *dentry,
47 const char *xattr_name,
48 void *xattr_value,
2960e6cb
DK
49 size_t xattr_value_len,
50 struct integrity_iint_cache *iint)
3e1be52d
MZ
51{
52 return INTEGRITY_UNKNOWN;
53}
54#endif
55
e1c9b23a 56static inline int evm_inode_setattr(struct dentry *dentry, struct iattr *attr)
817b54aa
MZ
57{
58 return 0;
59}
60
975d2943
MZ
61static inline void evm_inode_post_setattr(struct dentry *dentry, int ia_valid)
62{
63 return;
64}
65
3e1be52d
MZ
66static inline int evm_inode_setxattr(struct dentry *dentry, const char *name,
67 const void *value, size_t size)
68{
69 return 0;
70}
71
72static inline void evm_inode_post_setxattr(struct dentry *dentry,
73 const char *xattr_name,
74 const void *xattr_value,
75 size_t xattr_value_len)
76{
77 return;
78}
79
80static inline int evm_inode_removexattr(struct dentry *dentry,
81 const char *xattr_name)
82{
83 return 0;
84}
c7b87de2
MZ
85
86static inline void evm_inode_post_removexattr(struct dentry *dentry,
87 const char *xattr_name)
88{
89 return;
90}
91
cb723180
MZ
92static inline int evm_inode_init_security(struct inode *inode,
93 const struct xattr *xattr_array,
94 struct xattr *evm)
95{
5a4730ba 96 return 0;
cb723180
MZ
97}
98
e05a4f4f 99#endif /* CONFIG_EVM */
3e1be52d 100#endif /* LINUX_EVM_H */