diff options
author | Mimi Zohar <zohar@linux.ibm.com> | 2020-06-10 09:18:26 -0400 |
---|---|---|
committer | Mimi Zohar <zohar@linux.ibm.com> | 2020-06-12 11:30:18 -0400 |
commit | 4235b1a4efe19dd0309250170bbf0aa95e559626 (patch) | |
tree | 45de78666d03314849cb1ebcd8cc6413705bbfd2 /security | |
parent | 42413b49804b250ced70dac8815388af2d4ad872 (diff) | |
download | linux-stable-4235b1a4efe19dd0309250170bbf0aa95e559626.tar.gz linux-stable-4235b1a4efe19dd0309250170bbf0aa95e559626.tar.bz2 linux-stable-4235b1a4efe19dd0309250170bbf0aa95e559626.zip |
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>
Diffstat (limited to 'security')
-rw-r--r-- | security/integrity/ima/ima_main.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 800fb3bba418..c1583d98c5e5 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c @@ -419,7 +419,8 @@ int ima_file_mprotect(struct vm_area_struct *vma, unsigned long prot) int pcr; /* Is mprotect making an mmap'ed file executable? */ - if (!vma->vm_file || !(prot & PROT_EXEC) || (vma->vm_flags & VM_EXEC)) + if (!(ima_policy_flag & IMA_APPRAISE) || !vma->vm_file || + !(prot & PROT_EXEC) || (vma->vm_flags & VM_EXEC)) return 0; security_task_getsecid(current, &secid); |