From e57ac68378a287d6336d187b26971f35f7ee7251 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Thu, 18 Oct 2007 03:06:58 -0700 Subject: fuse: fix allowing operations The following operation didn't check if sending the request was allowed: setattr listxattr statfs Some other operations don't explicitly do the check, but VFS calls ->permission() which checks this. Signed-off-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/fuse/inode.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fs/fuse/inode.c') diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index fd0735715c1..00bb5a255de 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -287,6 +287,11 @@ static int fuse_statfs(struct dentry *dentry, struct kstatfs *buf) struct fuse_statfs_out outarg; int err; + if (!fuse_allow_task(fc, current)) { + buf->f_type = FUSE_SUPER_MAGIC; + return 0; + } + req = fuse_get_req(fc); if (IS_ERR(req)) return PTR_ERR(req); -- cgit v1.2.3