aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ima.h
diff options
context:
space:
mode:
authorMimi Zohar <zohar@linux.vnet.ibm.com>2009-02-04 09:07:02 -0500
committerJames Morris <jmorris@namei.org>2009-02-05 17:05:33 -0500
commit1df9f0a73178718969ae47d813b8e7aab2cf073c (patch)
tree6bd3d8838858f0e93acd8f7969b7d0e5ce2bfb08 /include/linux/ima.h
parentf4bd857bc8ed997c25ec06b56ef8064aafa6d4f3 (diff)
Integrity: IMA file free imbalance
The number of calls to ima_path_check()/ima_file_free() should be balanced. An extra call to fput(), indicates the file could have been accessed without first being measured. Although f_count is incremented/decremented in places other than fget/fput, like fget_light/fput_light and get_file, the current task must already hold a file refcnt. The call to __fput() is delayed until the refcnt becomes 0, resulting in ima_file_free() flagging any changes. - add hook to increment opencount for IPC shared memory(SYSV), shmat files, and /dev/zero - moved NULL iint test in opencount_get() Signed-off-by: Mimi Zohar <zohar@us.ibm.com> Acked-by: Serge Hallyn <serue@us.ibm.com> Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'include/linux/ima.h')
-rw-r--r--include/linux/ima.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/ima.h b/include/linux/ima.h
index dcc3664feee8..6db30a328d98 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -19,6 +19,7 @@ extern void ima_inode_free(struct inode *inode);
19extern int ima_path_check(struct path *path, int mask); 19extern int ima_path_check(struct path *path, int mask);
20extern void ima_file_free(struct file *file); 20extern void ima_file_free(struct file *file);
21extern int ima_file_mmap(struct file *file, unsigned long prot); 21extern int ima_file_mmap(struct file *file, unsigned long prot);
22extern void ima_shm_check(struct file *file);
22 23
23#else 24#else
24static inline int ima_bprm_check(struct linux_binprm *bprm) 25static inline int ima_bprm_check(struct linux_binprm *bprm)
@@ -50,5 +51,10 @@ static inline int ima_file_mmap(struct file *file, unsigned long prot)
50{ 51{
51 return 0; 52 return 0;
52} 53}
54
55static inline void ima_shm_check(struct file *file)
56{
57 return;
58}
53#endif /* CONFIG_IMA_H */ 59#endif /* CONFIG_IMA_H */
54#endif /* _LINUX_IMA_H */ 60#endif /* _LINUX_IMA_H */