aboutsummaryrefslogtreecommitdiffstats
path: root/security/security.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/security.c')
-rw-r--r--security/security.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/security/security.c b/security/security.c
index 351942a4ca0e..f6ac27cd3452 100644
--- a/security/security.c
+++ b/security/security.c
@@ -620,7 +620,13 @@ void security_inode_getsecid(const struct inode *inode, u32 *secid)
620 620
621int security_file_permission(struct file *file, int mask) 621int security_file_permission(struct file *file, int mask)
622{ 622{
623 return security_ops->file_permission(file, mask); 623 int ret;
624
625 ret = security_ops->file_permission(file, mask);
626 if (ret)
627 return ret;
628
629 return fsnotify_perm(file, mask);
624} 630}
625 631
626int security_file_alloc(struct file *file) 632int security_file_alloc(struct file *file)
@@ -684,7 +690,13 @@ int security_file_receive(struct file *file)
684 690
685int security_dentry_open(struct file *file, const struct cred *cred) 691int security_dentry_open(struct file *file, const struct cred *cred)
686{ 692{
687 return security_ops->dentry_open(file, cred); 693 int ret;
694
695 ret = security_ops->dentry_open(file, cred);
696 if (ret)
697 return ret;
698
699 return fsnotify_perm(file, MAY_OPEN);
688} 700}
689 701
690int security_task_create(unsigned long clone_flags) 702int security_task_create(unsigned long clone_flags)