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>
This commit is contained in:
Al Viro
2012-05-30 13:30:51 -04:00
parent d007794a18
commit e5467859f7
11 changed files with 64 additions and 78 deletions

View File

@@ -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;