diff options
Diffstat (limited to 'security/selinux/hooks.c')
-rw-r--r-- | security/selinux/hooks.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index dddb81e06d2d..e29800091e17 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -3557,6 +3557,18 @@ static int selinux_mmap_addr(unsigned long addr) | |||
3557 | static int selinux_mmap_file(struct file *file, unsigned long reqprot, | 3557 | static int selinux_mmap_file(struct file *file, unsigned long reqprot, |
3558 | unsigned long prot, unsigned long flags) | 3558 | unsigned long prot, unsigned long flags) |
3559 | { | 3559 | { |
3560 | struct common_audit_data ad; | ||
3561 | int rc; | ||
3562 | |||
3563 | if (file) { | ||
3564 | ad.type = LSM_AUDIT_DATA_FILE; | ||
3565 | ad.u.file = file; | ||
3566 | rc = inode_has_perm(current_cred(), file_inode(file), | ||
3567 | FILE__MAP, &ad); | ||
3568 | if (rc) | ||
3569 | return rc; | ||
3570 | } | ||
3571 | |||
3560 | if (selinux_checkreqprot) | 3572 | if (selinux_checkreqprot) |
3561 | prot = reqprot; | 3573 | prot = reqprot; |
3562 | 3574 | ||