diff options
author | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2011-02-22 10:19:43 -0500 |
---|---|---|
committer | Mimi Zohar <zohar@linux.vnet.ibm.com> | 2011-02-23 16:38:52 -0500 |
commit | 1adace9bb04a5f4a4dea9e642089102661bb0ceb (patch) | |
tree | 2396099935c50d838899a01da1438b8a441619de /security/integrity/ima/ima.h | |
parent | 854fdd55bfdd56cfc61bd30f2062a9268fcebba6 (diff) |
ima: remove unnecessary call to ima_must_measure
The original ima_must_measure() function based its results on cached
iint information, which required an iint be allocated for all files.
Currently, an iint is allocated only for files in policy. As a result,
for those files in policy, ima_must_measure() is now called twice: once
to determine if the inode is in the measurement policy and, the second
time, to determine if it needs to be measured/re-measured.
The second call to ima_must_measure() unnecessarily checks to see if
the file is in policy. As we already know the file is in policy, this
patch removes the second unnecessary call to ima_must_measure(), removes
the vestige iint parameter, and just checks the iint directly to determine
if the inode has been measured or needs to be measured/re-measured.
Signed-off-by: Mimi Zohar <zohar@us.ibm.com>
Acked-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'security/integrity/ima/ima.h')
-rw-r--r-- | security/integrity/ima/ima.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/security/integrity/ima/ima.h b/security/integrity/ima/ima.h index ac79032bdf23..08408bd71462 100644 --- a/security/integrity/ima/ima.h +++ b/security/integrity/ima/ima.h | |||
@@ -110,8 +110,7 @@ struct ima_iint_cache { | |||
110 | }; | 110 | }; |
111 | 111 | ||
112 | /* LIM API function definitions */ | 112 | /* LIM API function definitions */ |
113 | int ima_must_measure(struct ima_iint_cache *iint, struct inode *inode, | 113 | int ima_must_measure(struct inode *inode, int mask, int function); |
114 | int mask, int function); | ||
115 | int ima_collect_measurement(struct ima_iint_cache *iint, struct file *file); | 114 | int ima_collect_measurement(struct ima_iint_cache *iint, struct file *file); |
116 | void ima_store_measurement(struct ima_iint_cache *iint, struct file *file, | 115 | void ima_store_measurement(struct ima_iint_cache *iint, struct file *file, |
117 | const unsigned char *filename); | 116 | const unsigned char *filename); |