integrity.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * Copyright (C) 2009 IBM Corporation
  3. * Author: Mimi Zohar <zohar@us.ibm.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, version 2 of the License.
  8. */
  9. #ifndef _LINUX_INTEGRITY_H
  10. #define _LINUX_INTEGRITY_H
  11. #include <linux/fs.h>
  12. enum integrity_status {
  13. INTEGRITY_PASS = 0,
  14. INTEGRITY_PASS_IMMUTABLE,
  15. INTEGRITY_FAIL,
  16. INTEGRITY_NOLABEL,
  17. INTEGRITY_NOXATTRS,
  18. INTEGRITY_UNKNOWN,
  19. };
  20. /* List of EVM protected security xattrs */
  21. #ifdef CONFIG_INTEGRITY
  22. extern struct integrity_iint_cache *integrity_inode_get(struct inode *inode);
  23. extern void integrity_inode_free(struct inode *inode);
  24. extern void __init integrity_load_keys(void);
  25. #else
  26. static inline struct integrity_iint_cache *
  27. integrity_inode_get(struct inode *inode)
  28. {
  29. return NULL;
  30. }
  31. static inline void integrity_inode_free(struct inode *inode)
  32. {
  33. return;
  34. }
  35. static inline void integrity_load_keys(void)
  36. {
  37. }
  38. #endif /* CONFIG_INTEGRITY */
  39. #ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS
  40. extern int integrity_kernel_module_request(char *kmod_name);
  41. #else
  42. static inline int integrity_kernel_module_request(char *kmod_name)
  43. {
  44. return 0;
  45. }
  46. #endif /* CONFIG_INTEGRITY_ASYMMETRIC_KEYS */
  47. #endif /* _LINUX_INTEGRITY_H */