ima.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (C) 2008 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_IMA_H
  10. #define _LINUX_IMA_H
  11. #include <linux/fs.h>
  12. struct linux_binprm;
  13. #define IMA_COUNT_UPDATE 1
  14. #define IMA_COUNT_LEAVE 0
  15. #ifdef CONFIG_IMA
  16. extern int ima_bprm_check(struct linux_binprm *bprm);
  17. extern int ima_inode_alloc(struct inode *inode);
  18. extern void ima_inode_free(struct inode *inode);
  19. extern int ima_path_check(struct path *path, int mask, int update_counts);
  20. extern void ima_file_free(struct file *file);
  21. extern int ima_file_mmap(struct file *file, unsigned long prot);
  22. extern void ima_counts_get(struct file *file);
  23. extern void ima_counts_put(struct path *path, int mask);
  24. #else
  25. static inline int ima_bprm_check(struct linux_binprm *bprm)
  26. {
  27. return 0;
  28. }
  29. static inline int ima_inode_alloc(struct inode *inode)
  30. {
  31. return 0;
  32. }
  33. static inline void ima_inode_free(struct inode *inode)
  34. {
  35. return;
  36. }
  37. static inline int ima_path_check(struct path *path, int mask, int update_counts)
  38. {
  39. return 0;
  40. }
  41. static inline void ima_file_free(struct file *file)
  42. {
  43. return;
  44. }
  45. static inline int ima_file_mmap(struct file *file, unsigned long prot)
  46. {
  47. return 0;
  48. }
  49. static inline void ima_counts_get(struct file *file)
  50. {
  51. return;
  52. }
  53. static inline void ima_counts_put(struct path *path, int mask)
  54. {
  55. return;
  56. }
  57. #endif /* CONFIG_IMA_H */
  58. #endif /* _LINUX_IMA_H */