aboutsummaryrefslogtreecommitdiffstats
path: root/security/security.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/security.c')
-rw-r--r--security/security.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/security/security.c b/security/security.c
index e8c87b8601b4..c53949f17d9e 100644
--- a/security/security.c
+++ b/security/security.c
@@ -619,7 +619,13 @@ void security_inode_getsecid(const struct inode *inode, u32 *secid)
619 619
620int security_file_permission(struct file *file, int mask) 620int security_file_permission(struct file *file, int mask)
621{ 621{
622 return security_ops->file_permission(file, mask); 622 int ret;
623
624 ret = security_ops->file_permission(file, mask);
625 if (ret)
626 return ret;
627
628 return fsnotify_perm(file, mask);
623} 629}
624 630
625int security_file_alloc(struct file *file) 631int security_file_alloc(struct file *file)
@@ -683,7 +689,13 @@ int security_file_receive(struct file *file)
683 689
684int security_dentry_open(struct file *file, const struct cred *cred) 690int security_dentry_open(struct file *file, const struct cred *cred)
685{ 691{
686 return security_ops->dentry_open(file, cred); 692 int ret;
693
694 ret = security_ops->dentry_open(file, cred);
695 if (ret)
696 return ret;
697
698 return fsnotify_perm(file, MAY_OPEN);
687} 699}
688 700
689int security_task_create(unsigned long clone_flags) 701int security_task_create(unsigned long clone_flags)
@@ -768,9 +780,10 @@ int security_task_getioprio(struct task_struct *p)
768 return security_ops->task_getioprio(p); 780 return security_ops->task_getioprio(p);
769} 781}
770 782
771int security_task_setrlimit(unsigned int resource, struct rlimit *new_rlim) 783int security_task_setrlimit(struct task_struct *p, unsigned int resource,
784 struct rlimit *new_rlim)
772{ 785{
773 return security_ops->task_setrlimit(resource, new_rlim); 786 return security_ops->task_setrlimit(p, resource, new_rlim);
774} 787}
775 788
776int security_task_setscheduler(struct task_struct *p, 789int security_task_setscheduler(struct task_struct *p,