summaryrefslogtreecommitdiffstats
path: root/security
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-06-12 21:02:41 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2020-06-12 21:02:41 +0200
commit923ea1631e942f8af179ca418e0cc1915025e4c2 (patch)
tree1ce8f2af7ae5f8bafd0820eac0546961909d1cbc /security
parentMerge tag 'devicetree-fixes-for-5.8-1' of git://git.kernel.org/pub/scm/linux/... (diff)
parentima: fix mprotect checking (diff)
downloadlinux-923ea1631e942f8af179ca418e0cc1915025e4c2.tar.xz
linux-923ea1631e942f8af179ca418e0cc1915025e4c2.zip
Merge tag 'integrity-v5.8-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
Pull integrity fix from Mimi Zohar: "ima mprotect performance fix" * tag 'integrity-v5.8-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: ima: fix mprotect checking
Diffstat (limited to 'security')
-rw-r--r--security/integrity/ima/ima_main.c3
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);