If tmpfiles can be made persistent, then newly created tmpfiles need to be treated like any other new files in policy. This patch indicates which newly created tmpfiles are in policy, causing the file hash to be calculated on __fput().
Showing the changes to include/linux (1 of 3 files). Show all
Unified · Split
| @@ -18,6 +18,7 @@ struct linux_binprm; · 17 unmodified lines | |||
| 18 | #ifdef CONFIG_IMA | 18 | #ifdef CONFIG_IMA |
| 19 | extern int ima_bprm_check(struct linux_binprm *bprm); | 19 | extern int ima_bprm_check(struct linux_binprm *bprm); |
| 20 | extern int ima_file_check(struct file *file, int mask); | 20 | extern int ima_file_check(struct file *file, int mask); |
| 21 | extern void ima_post_create_tmpfile(struct inode *inode); | ||
| 21 | extern void ima_file_free(struct file *file); | 22 | extern void ima_file_free(struct file *file); |
| 22 | extern int ima_file_mmap(struct file *file, unsigned long prot); | 23 | extern int ima_file_mmap(struct file *file, unsigned long prot); |
| 23 | extern int ima_load_data(enum kernel_load_data_id id); | 24 | extern int ima_load_data(enum kernel_load_data_id id); |
| @@ -56,6 +57,10 @@ static inline int ima_file_check(struct file *file, int mask) · 32 unmodified lines | |||
| 56 | return 0; | 57 | return 0; |
| 57 | } | 58 | } |
| 58 | 59 | ||
| 60 | static inline void ima_post_create_tmpfile(struct inode *inode) | ||
| 61 | { | ||
| 62 | } | ||
| 63 | |||
| 59 | static inline void ima_file_free(struct file *file) | 64 | static inline void ima_file_free(struct file *file) |
| 60 | { | 65 | { |
| 61 | return; | 66 | return; |