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

@@ -657,18 +657,22 @@ int security_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return security_ops->file_ioctl(file, cmd, arg);
}
int security_file_mmap(struct file *file, unsigned long reqprot,
unsigned long prot, unsigned long flags,
unsigned long addr, unsigned long addr_only)
int security_mmap_file(struct file *file, unsigned long reqprot,
unsigned long prot, unsigned long flags)
{
int ret;
ret = security_ops->file_mmap(file, reqprot, prot, flags, addr, addr_only);
ret = security_ops->mmap_file(file, reqprot, prot, flags);
if (ret)
return ret;
return ima_file_mmap(file, prot);
}
int security_mmap_addr(unsigned long addr)
{
return security_ops->mmap_addr(addr);
}
int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot,
unsigned long prot)
{