blob: 33a92471e463abc7569f36755799c379550712b7 [file] [log] [blame]
Mimi Zohar3e1be522011-03-09 14:38:26 -05001/*
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>
12
13#ifdef CONFIG_EVM
14extern enum integrity_status evm_verifyxattr(struct dentry *dentry,
15 const char *xattr_name,
16 void *xattr_value,
17 size_t xattr_value_len);
Mimi Zohar975d2942011-03-09 14:39:57 -050018extern void evm_inode_post_setattr(struct dentry *dentry, int ia_valid);
Mimi Zohar3e1be522011-03-09 14:38:26 -050019extern int evm_inode_setxattr(struct dentry *dentry, const char *name,
20 const void *value, size_t size);
21extern void evm_inode_post_setxattr(struct dentry *dentry,
22 const char *xattr_name,
23 const void *xattr_value,
24 size_t xattr_value_len);
25extern int evm_inode_removexattr(struct dentry *dentry, const char *xattr_name);
Mimi Zoharc7b87de2011-03-09 14:39:18 -050026extern void evm_inode_post_removexattr(struct dentry *dentry,
27 const char *xattr_name);
Mimi Zohar3e1be522011-03-09 14:38:26 -050028#else
29#ifdef CONFIG_INTEGRITY
30static inline enum integrity_status evm_verifyxattr(struct dentry *dentry,
31 const char *xattr_name,
32 void *xattr_value,
33 size_t xattr_value_len)
34{
35 return INTEGRITY_UNKNOWN;
36}
37#endif
38
Mimi Zohar975d2942011-03-09 14:39:57 -050039static inline void evm_inode_post_setattr(struct dentry *dentry, int ia_valid)
40{
41 return;
42}
43
Mimi Zohar3e1be522011-03-09 14:38:26 -050044static inline int evm_inode_setxattr(struct dentry *dentry, const char *name,
45 const void *value, size_t size)
46{
47 return 0;
48}
49
50static inline void evm_inode_post_setxattr(struct dentry *dentry,
51 const char *xattr_name,
52 const void *xattr_value,
53 size_t xattr_value_len)
54{
55 return;
56}
57
58static inline int evm_inode_removexattr(struct dentry *dentry,
59 const char *xattr_name)
60{
61 return 0;
62}
Mimi Zoharc7b87de2011-03-09 14:39:18 -050063
64static inline void evm_inode_post_removexattr(struct dentry *dentry,
65 const char *xattr_name)
66{
67 return;
68}
69
Mimi Zohar3e1be522011-03-09 14:38:26 -050070#endif /* CONFIG_EVM_H */
71#endif /* LINUX_EVM_H */