evm.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * evm.h
  3. *
  4. * Copyright (c) 2009 IBM Corporation
  5. * Author: Mimi Zohar <zohar@us.ibm.com>
  6. */
  7. #ifndef _LINUX_EVM_H
  8. #define _LINUX_EVM_H
  9. #include <linux/integrity.h>
  10. #ifdef CONFIG_EVM
  11. extern enum integrity_status evm_verifyxattr(struct dentry *dentry,
  12. const char *xattr_name,
  13. void *xattr_value,
  14. size_t xattr_value_len);
  15. extern int evm_inode_setxattr(struct dentry *dentry, const char *name,
  16. const void *value, size_t size);
  17. extern void evm_inode_post_setxattr(struct dentry *dentry,
  18. const char *xattr_name,
  19. const void *xattr_value,
  20. size_t xattr_value_len);
  21. extern int evm_inode_removexattr(struct dentry *dentry, const char *xattr_name);
  22. extern void evm_inode_post_removexattr(struct dentry *dentry,
  23. const char *xattr_name);
  24. #else
  25. #ifdef CONFIG_INTEGRITY
  26. static inline enum integrity_status evm_verifyxattr(struct dentry *dentry,
  27. const char *xattr_name,
  28. void *xattr_value,
  29. size_t xattr_value_len)
  30. {
  31. return INTEGRITY_UNKNOWN;
  32. }
  33. #endif
  34. static inline int evm_inode_setxattr(struct dentry *dentry, const char *name,
  35. const void *value, size_t size)
  36. {
  37. return 0;
  38. }
  39. static inline void evm_inode_post_setxattr(struct dentry *dentry,
  40. const char *xattr_name,
  41. const void *xattr_value,
  42. size_t xattr_value_len)
  43. {
  44. return;
  45. }
  46. static inline int evm_inode_removexattr(struct dentry *dentry,
  47. const char *xattr_name)
  48. {
  49. return 0;
  50. }
  51. static inline void evm_inode_post_removexattr(struct dentry *dentry,
  52. const char *xattr_name)
  53. {
  54. return;
  55. }
  56. #endif /* CONFIG_EVM_H */
  57. #endif /* LINUX_EVM_H */