diff options
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/dev.c | 4 | ||||
-rw-r--r-- | fs/fuse/dir.c | 23 | ||||
-rw-r--r-- | fs/fuse/file.c | 4 |
3 files changed, 19 insertions, 12 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 69ebf2ecb089..e0c7ada08a1f 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
@@ -87,8 +87,8 @@ static void __fuse_put_request(struct fuse_req *req) | |||
87 | 87 | ||
88 | static void fuse_req_init_context(struct fuse_req *req) | 88 | static void fuse_req_init_context(struct fuse_req *req) |
89 | { | 89 | { |
90 | req->in.h.uid = current->fsuid; | 90 | req->in.h.uid = current_fsuid(); |
91 | req->in.h.gid = current->fsgid; | 91 | req->in.h.gid = current_fsgid(); |
92 | req->in.h.pid = current->pid; | 92 | req->in.h.pid = current->pid; |
93 | } | 93 | } |
94 | 94 | ||
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index f310768a02fe..fdff346e96fd 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -871,18 +871,25 @@ int fuse_update_attributes(struct inode *inode, struct kstat *stat, | |||
871 | */ | 871 | */ |
872 | int fuse_allow_task(struct fuse_conn *fc, struct task_struct *task) | 872 | int fuse_allow_task(struct fuse_conn *fc, struct task_struct *task) |
873 | { | 873 | { |
874 | const struct cred *cred; | ||
875 | int ret; | ||
876 | |||
874 | if (fc->flags & FUSE_ALLOW_OTHER) | 877 | if (fc->flags & FUSE_ALLOW_OTHER) |
875 | return 1; | 878 | return 1; |
876 | 879 | ||
877 | if (task->euid == fc->user_id && | 880 | rcu_read_lock(); |
878 | task->suid == fc->user_id && | 881 | ret = 0; |
879 | task->uid == fc->user_id && | 882 | cred = __task_cred(task); |
880 | task->egid == fc->group_id && | 883 | if (cred->euid == fc->user_id && |
881 | task->sgid == fc->group_id && | 884 | cred->suid == fc->user_id && |
882 | task->gid == fc->group_id) | 885 | cred->uid == fc->user_id && |
883 | return 1; | 886 | cred->egid == fc->group_id && |
887 | cred->sgid == fc->group_id && | ||
888 | cred->gid == fc->group_id) | ||
889 | ret = 1; | ||
890 | rcu_read_unlock(); | ||
884 | 891 | ||
885 | return 0; | 892 | return ret; |
886 | } | 893 | } |
887 | 894 | ||
888 | static int fuse_access(struct inode *inode, int mask) | 895 | static int fuse_access(struct inode *inode, int mask) |
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 1a057f02e7da..e8162646a9b5 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -655,7 +655,7 @@ static int fuse_write_begin(struct file *file, struct address_space *mapping, | |||
655 | { | 655 | { |
656 | pgoff_t index = pos >> PAGE_CACHE_SHIFT; | 656 | pgoff_t index = pos >> PAGE_CACHE_SHIFT; |
657 | 657 | ||
658 | *pagep = __grab_cache_page(mapping, index); | 658 | *pagep = grab_cache_page_write_begin(mapping, index, flags); |
659 | if (!*pagep) | 659 | if (!*pagep) |
660 | return -ENOMEM; | 660 | return -ENOMEM; |
661 | return 0; | 661 | return 0; |
@@ -788,7 +788,7 @@ static ssize_t fuse_fill_write_pages(struct fuse_req *req, | |||
788 | break; | 788 | break; |
789 | 789 | ||
790 | err = -ENOMEM; | 790 | err = -ENOMEM; |
791 | page = __grab_cache_page(mapping, index); | 791 | page = grab_cache_page_write_begin(mapping, index, 0); |
792 | if (!page) | 792 | if (!page) |
793 | break; | 793 | break; |
794 | 794 | ||