ima: fix mprotect checking
authorMimi Zohar <zohar@linux.ibm.com>
Wed, 10 Jun 2020 13:18:26 +0000 (09:18 -0400)
committerMimi Zohar <zohar@linux.ibm.com>
Fri, 12 Jun 2020 15:30:18 +0000 (11:30 -0400)
commit4235b1a4efe19dd0309250170bbf0aa95e559626
tree45de78666d03314849cb1ebcd8cc6413705bbfd2
parent42413b49804b250ced70dac8815388af2d4ad872
ima: fix mprotect checking

Make sure IMA is enabled before checking mprotect change.  Addresses
report of a 3.7% regression of boot-time.dhcp.

Fixes: 8eb613c0b8f1 ("ima: verify mprotect change is consistent with mmap policy")
Reported-by: kernel test robot <rong.a.chen@intel.com>
Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Tested-by: Xing Zhengjun <zhengjun.xing@linux.intel.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/integrity/ima/ima_main.c