summaryrefslogtreecommitdiff
path: root/security/security.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2023-02-22 23:36:25 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2023-02-22 23:36:25 +0300
commit67e2dcff8b21923d48f5ca835773b2f005389e69 (patch)
treed82794c38da99b40ed452fb658a4e772e65c3e16 /security/security.c
parent70756b49be4ea8bf36a664322df6e7e89895fa60 (diff)
parent4958db3245fa655bf18251bd2a83bcc164071c39 (diff)
downloadlinux-67e2dcff8b21923d48f5ca835773b2f005389e69.tar.xz
Merge tag 'integrity-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity
Pull integrity update from Mimi Zohar: "One doc and one code cleanup, and two bug fixes" * tag 'integrity-v6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/zohar/linux-integrity: ima: Introduce MMAP_CHECK_REQPROT hook ima: Align ima_file_mmap() parameters with mmap_file LSM hook evm: call dump_security_xattr() in all cases to remove code duplication ima: fix ima_delete_rules() kernel-doc warning ima: return IMA digest value only when IMA_COLLECTED flag is set ima: fix error handling logic when file measurement failed
Diffstat (limited to 'security/security.c')
-rw-r--r--security/security.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/security/security.c b/security/security.c
index 4e1150c44ab7..cf6cc576736f 100644
--- a/security/security.c
+++ b/security/security.c
@@ -1661,12 +1661,13 @@ static inline unsigned long mmap_prot(struct file *file, unsigned long prot)
int security_mmap_file(struct file *file, unsigned long prot,
unsigned long flags)
{
+ unsigned long prot_adj = mmap_prot(file, prot);
int ret;
- ret = call_int_hook(mmap_file, 0, file, prot,
- mmap_prot(file, prot), flags);
+
+ ret = call_int_hook(mmap_file, 0, file, prot, prot_adj, flags);
if (ret)
return ret;
- return ima_file_mmap(file, prot);
+ return ima_file_mmap(file, prot, prot_adj, flags);
}
int security_mmap_addr(unsigned long addr)