ima: prevent unnecessary policy checking
authorDmitry Kasatkin <d.kasatkin@samsung.com>
Thu, 27 Mar 2014 08:54:11 +0000 (10:54 +0200)
committerMimi Zohar <zohar@linux.vnet.ibm.com>
Thu, 12 Jun 2014 21:58:06 +0000 (17:58 -0400)
commitb882fae2d3a832fdcdc194c9f358390b1efca8e7
tree2f9f2a00683176e02fee1acd59db3705a9228f35
parent3e38df56e6ef736f3ab516664697b55caa8f3238
ima: prevent unnecessary policy checking

ima_rdwr_violation_check is called for every file openning.
The function checks the policy even when violation condition
is not met. It causes unnecessary policy checking.

This patch does policy checking only if violation condition is met.

Changelog:
- check writecount is greater than zero (Mimi)

Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
security/integrity/ima/ima_main.c