evm.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 void evm_inode_post_setattr(struct dentry *dentry, int ia_valid);
  16. extern int evm_inode_setxattr(struct dentry *dentry, const char *name,
  17. const void *value, size_t size);
  18. extern void evm_inode_post_setxattr(struct dentry *dentry,
  19. const char *xattr_name,
  20. const void *xattr_value,
  21. size_t xattr_value_len);
  22. extern int evm_inode_removexattr(struct dentry *dentry, const char *xattr_name);
  23. extern void evm_inode_post_removexattr(struct dentry *dentry,
  24. const char *xattr_name);
  25. #else
  26. #ifdef CONFIG_INTEGRITY
  27. static inline enum integrity_status evm_verifyxattr(struct dentry *dentry,
  28. const char *xattr_name,
  29. void *xattr_value,
  30. size_t xattr_value_len)
  31. {
  32. return INTEGRITY_UNKNOWN;
  33. }
  34. #endif
  35. static inline void evm_inode_post_setattr(struct dentry *dentry, int ia_valid)
  36. {
  37. return;
  38. }
  39. static inline int evm_inode_setxattr(struct dentry *dentry, const char *name,
  40. const void *value, size_t size)
  41. {
  42. return 0;
  43. }
  44. static inline void evm_inode_post_setxattr(struct dentry *dentry,
  45. const char *xattr_name,
  46. const void *xattr_value,
  47. size_t xattr_value_len)
  48. {
  49. return;
  50. }
  51. static inline int evm_inode_removexattr(struct dentry *dentry,
  52. const char *xattr_name)
  53. {
  54. return 0;
  55. }
  56. static inline void evm_inode_post_removexattr(struct dentry *dentry,
  57. const char *xattr_name)
  58. {
  59. return;
  60. }
  61. #endif /* CONFIG_EVM_H */
  62. #endif /* LINUX_EVM_H */