diff options
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index e97a98981862..95bc22bdd060 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -869,18 +869,25 @@ int fuse_update_attributes(struct inode *inode, struct kstat *stat, | |||
869 | */ | 869 | */ |
870 | int fuse_allow_task(struct fuse_conn *fc, struct task_struct *task) | 870 | int fuse_allow_task(struct fuse_conn *fc, struct task_struct *task) |
871 | { | 871 | { |
872 | const struct cred *cred; | ||
873 | int ret; | ||
874 | |||
872 | if (fc->flags & FUSE_ALLOW_OTHER) | 875 | if (fc->flags & FUSE_ALLOW_OTHER) |
873 | return 1; | 876 | return 1; |
874 | 877 | ||
875 | if (task->cred->euid == fc->user_id && | 878 | rcu_read_lock(); |
876 | task->cred->suid == fc->user_id && | 879 | ret = 0; |
877 | task->cred->uid == fc->user_id && | 880 | cred = __task_cred(task); |
878 | task->cred->egid == fc->group_id && | 881 | if (cred->euid == fc->user_id && |
879 | task->cred->sgid == fc->group_id && | 882 | cred->suid == fc->user_id && |
880 | task->cred->gid == fc->group_id) | 883 | cred->uid == fc->user_id && |
881 | return 1; | 884 | cred->egid == fc->group_id && |
885 | cred->sgid == fc->group_id && | ||
886 | cred->gid == fc->group_id) | ||
887 | ret = 1; | ||
888 | rcu_read_unlock(); | ||
882 | 889 | ||
883 | return 0; | 890 | return ret; |
884 | } | 891 | } |
885 | 892 | ||
886 | static int fuse_access(struct inode *inode, int mask) | 893 | static int fuse_access(struct inode *inode, int mask) |