summaryrefslogtreecommitdiffstats
path: root/mm/nommu.c
diff options
context:
space:
mode:
authorAl Viro2012-05-30 19:30:51 +0200
committerAl Viro2012-05-31 19:11:54 +0200
commite5467859f7f79b69fc49004403009dfdba3bec53 (patch)
tree73b011daf79eeddd61bbcaf65cd197b5e5f6f149 /mm/nommu.c
parentsplit cap_mmap_addr() out of cap_file_mmap() (diff)
downloadkernel-qcow2-linux-e5467859f7f79b69fc49004403009dfdba3bec53.tar.gz
kernel-qcow2-linux-e5467859f7f79b69fc49004403009dfdba3bec53.tar.xz
kernel-qcow2-linux-e5467859f7f79b69fc49004403009dfdba3bec53.zip
split ->file_mmap() into ->mmap_addr()/->mmap_file()
... i.e. file-dependent and address-dependent checks. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/nommu.c')
-rw-r--r--mm/nommu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/nommu.c b/mm/nommu.c
index de6084e3a046..acfe419785db 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1047,7 +1047,10 @@ static int validate_mmap_request(struct file *file,
}
/* allow the security API to have its say */
- ret = security_file_mmap(file, reqprot, prot, flags, addr, 0);
+ ret = security_mmap_addr(addr);
+ if (ret < 0)
+ return ret;
+ ret = security_mmap_file(file, reqprot, prot, flags);
if (ret < 0)
return ret;