integrity.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2009 IBM Corporation
  4. * Author: Mimi Zohar <[email protected]>
  5. */
  6. #ifndef _LINUX_INTEGRITY_H
  7. #define _LINUX_INTEGRITY_H
  8. #include <linux/fs.h>
  9. enum integrity_status {
  10. INTEGRITY_PASS = 0,
  11. INTEGRITY_PASS_IMMUTABLE,
  12. INTEGRITY_FAIL,
  13. INTEGRITY_FAIL_IMMUTABLE,
  14. INTEGRITY_NOLABEL,
  15. INTEGRITY_NOXATTRS,
  16. INTEGRITY_UNKNOWN,
  17. };
  18. /* List of EVM protected security xattrs */
  19. #ifdef CONFIG_INTEGRITY
  20. extern struct integrity_iint_cache *integrity_inode_get(struct inode *inode);
  21. extern void integrity_inode_free(struct inode *inode);
  22. extern void __init integrity_load_keys(void);
  23. #else
  24. static inline struct integrity_iint_cache *
  25. integrity_inode_get(struct inode *inode)
  26. {
  27. return NULL;
  28. }
  29. static inline void integrity_inode_free(struct inode *inode)
  30. {
  31. return;
  32. }
  33. static inline void integrity_load_keys(void)
  34. {
  35. }
  36. #endif /* CONFIG_INTEGRITY */
  37. #ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS
  38. extern int integrity_kernel_module_request(char *kmod_name);
  39. #else
  40. static inline int integrity_kernel_module_request(char *kmod_name)
  41. {
  42. return 0;
  43. }
  44. #endif /* CONFIG_INTEGRITY_ASYMMETRIC_KEYS */
  45. #endif /* _LINUX_INTEGRITY_H */