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, 16 insertions, 5 deletions
diff --git a/security/security.c b/security/security.c
index aa510609a955..c53949f17d9e 100644
--- a/security/security.c
+++ b/security/security.c
@@ -417,12 +417,11 @@ int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
417 new_dentry); 417 new_dentry);
418} 418}
419 419
420int security_path_truncate(struct path *path, loff_t length, 420int security_path_truncate(struct path *path)
421 unsigned int time_attrs)
422{ 421{
423 if (unlikely(IS_PRIVATE(path->dentry->d_inode))) 422 if (unlikely(IS_PRIVATE(path->dentry->d_inode)))
424 return 0; 423 return 0;
425 return security_ops->path_truncate(path, length, time_attrs); 424 return security_ops->path_truncate(path);
426} 425}
427 426
428int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, 427int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
@@ -620,7 +619,13 @@ void security_inode_getsecid(const struct inode *inode, u32 *secid)
620 619
621int security_file_permission(struct file *file, int mask) 620int security_file_permission(struct file *file, int mask)
622{ 621{
623 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);
624} 629}
625 630
626int security_file_alloc(struct file *file) 631int security_file_alloc(struct file *file)
@@ -684,7 +689,13 @@ int security_file_receive(struct file *file)
684 689
685int security_dentry_open(struct file *file, const struct cred *cred) 690int security_dentry_open(struct file *file, const struct cred *cred)
686{ 691{
687 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);
688} 699}
689 700
690int security_task_create(unsigned long clone_flags) 701int security_task_create(unsigned long clone_flags)