]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/evm.h
mm/hotplug: invalid PFNs from pfn_to_online_page()
[mirror_ubuntu-bionic-kernel.git] / include / linux / evm.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
3e1be52d
MZ
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>
cb723180 13#include <linux/xattr.h>
3e1be52d 14
2960e6cb
DK
15struct integrity_iint_cache;
16
3e1be52d 17#ifdef CONFIG_EVM
76266763 18extern int evm_set_key(void *key, size_t keylen);
3e1be52d
MZ
19extern enum integrity_status evm_verifyxattr(struct dentry *dentry,
20 const char *xattr_name,
21 void *xattr_value,
2960e6cb
DK
22 size_t xattr_value_len,
23 struct integrity_iint_cache *iint);
817b54aa 24extern int evm_inode_setattr(struct dentry *dentry, struct iattr *attr);
975d2943 25extern void evm_inode_post_setattr(struct dentry *dentry, int ia_valid);
3e1be52d
MZ
26extern int evm_inode_setxattr(struct dentry *dentry, const char *name,
27 const void *value, size_t size);
28extern void evm_inode_post_setxattr(struct dentry *dentry,
29 const char *xattr_name,
30 const void *xattr_value,
31 size_t xattr_value_len);
32extern int evm_inode_removexattr(struct dentry *dentry, const char *xattr_name);
c7b87de2
MZ
33extern void evm_inode_post_removexattr(struct dentry *dentry,
34 const char *xattr_name);
cb723180
MZ
35extern int evm_inode_init_security(struct inode *inode,
36 const struct xattr *xattr_array,
37 struct xattr *evm);
bf6d0f5d
MZ
38#ifdef CONFIG_FS_POSIX_ACL
39extern int posix_xattr_acl(const char *xattrname);
40#else
41static inline int posix_xattr_acl(const char *xattrname)
42{
43 return 0;
44}
45#endif
3e1be52d 46#else
76266763
DK
47
48static inline int evm_set_key(void *key, size_t keylen)
49{
50 return -EOPNOTSUPP;
51}
52
3e1be52d
MZ
53#ifdef CONFIG_INTEGRITY
54static inline enum integrity_status evm_verifyxattr(struct dentry *dentry,
55 const char *xattr_name,
56 void *xattr_value,
2960e6cb
DK
57 size_t xattr_value_len,
58 struct integrity_iint_cache *iint)
3e1be52d
MZ
59{
60 return INTEGRITY_UNKNOWN;
61}
62#endif
63
e1c9b23a 64static inline int evm_inode_setattr(struct dentry *dentry, struct iattr *attr)
817b54aa
MZ
65{
66 return 0;
67}
68
975d2943
MZ
69static inline void evm_inode_post_setattr(struct dentry *dentry, int ia_valid)
70{
71 return;
72}
73
3e1be52d
MZ
74static inline int evm_inode_setxattr(struct dentry *dentry, const char *name,
75 const void *value, size_t size)
76{
77 return 0;
78}
79
80static 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
88static inline int evm_inode_removexattr(struct dentry *dentry,
89 const char *xattr_name)
90{
91 return 0;
92}
c7b87de2
MZ
93
94static inline void evm_inode_post_removexattr(struct dentry *dentry,
95 const char *xattr_name)
96{
97 return;
98}
99
cb723180
MZ
100static inline int evm_inode_init_security(struct inode *inode,
101 const struct xattr *xattr_array,
102 struct xattr *evm)
103{
5a4730ba 104 return 0;
cb723180
MZ
105}
106
e05a4f4f 107#endif /* CONFIG_EVM */
3e1be52d 108#endif /* LINUX_EVM_H */