1 From 8a3177db59cd644fde05ba9efee29392dfdec8aa Mon Sep 17 00:00:00 2001
2 From: Miklos Szeredi <mszeredi@redhat.com>
3 Date: Wed, 16 Jan 2019 10:27:59 +0100
4 Subject: cuse: fix ioctl
6 From: Miklos Szeredi <mszeredi@redhat.com>
8 commit 8a3177db59cd644fde05ba9efee29392dfdec8aa upstream.
10 cuse_process_init_reply() doesn't initialize fc->max_pages and thus all
11 cuse bases ioctls fail with ENOMEM.
13 Reported-by: Andreas Steinmetz <ast@domdv.de>
14 Fixes: 5da784cce430 ("fuse: add max_pages to init_out")
15 Cc: <stable@vger.kernel.org> # v4.20
16 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
17 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20 fs/fuse/inode.c | 2 +-
21 1 file changed, 1 insertion(+), 1 deletion(-)
25 @@ -628,6 +628,7 @@ void fuse_conn_init(struct fuse_conn *fc
26 get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key));
27 fc->pid_ns = get_pid_ns(task_active_pid_ns(current));
28 fc->user_ns = get_user_ns(user_ns);
29 + fc->max_pages = FUSE_DEFAULT_MAX_PAGES_PER_REQ;
31 EXPORT_SYMBOL_GPL(fuse_conn_init);
33 @@ -1162,7 +1163,6 @@ static int fuse_fill_super(struct super_
34 fc->user_id = d.user_id;
35 fc->group_id = d.group_id;
36 fc->max_read = max_t(unsigned, 4096, d.max_read);
37 - fc->max_pages = FUSE_DEFAULT_MAX_PAGES_PER_REQ;
39 /* Used by get_root_inode() */