提交 4235b1a4 编写于 作者: M Mimi Zohar

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: 8eb613c0 ("ima: verify mprotect change is consistent with mmap policy")
Reported-by: Nkernel test robot <rong.a.chen@intel.com>
Reviewed-by: NLakshmi Ramasubramanian <nramas@linux.microsoft.com>
Tested-by: NXing Zhengjun <zhengjun.xing@linux.intel.com>
Signed-off-by: NMimi Zohar <zohar@linux.ibm.com>
上级 42413b49
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册