ima: remove unnecessary call to ima_must_measure
authorMimi Zohar <zohar@linux.vnet.ibm.com>
Tue, 22 Feb 2011 15:19:43 +0000 (10:19 -0500)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Wed, 23 Feb 2011 21:38:52 +0000 (16:38 -0500)
commit1adace9bb04a5f4a4dea9e642089102661bb0ceb
tree2396099935c50d838899a01da1438b8a441619de
parent854fdd55bfdd56cfc61bd30f2062a9268fcebba6
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>
security/integrity/ima/ima.h
security/integrity/ima/ima_api.c
security/integrity/ima/ima_main.c