1. 12 Sep, 2019 2 commits
    • Stefan Hajnoczi's avatar
      fuse: export fuse_end_request() · 04ec5af0
      Stefan Hajnoczi authored
      virtio-fs will need to complete requests from outside fs/fuse/dev.c.  Make
      the symbol visible.
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      04ec5af0
    • Miklos Szeredi's avatar
      fuse: fix request limit · f22f812d
      Miklos Szeredi authored
      The size of struct fuse_req was reduced from 392B to 144B on a non-debug
      config, thus the sanitize_global_limit() helper was setting a larger
      default limit.  This doesn't really reflect reduction in the memory used by
      requests, since the fields removed from fuse_req were added to fuse_args
      derived structs; e.g. sizeof(struct fuse_writepages_args) is 248B, thus
      resulting in slightly more memory being used for writepage requests
      overalll (due to using 256B slabs).
      
      Make the calculatation ignore the size of fuse_req and use the old 392B
      value.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      f22f812d
  2. 10 Sep, 2019 30 commits
  3. 06 Sep, 2019 3 commits
  4. 05 Sep, 2019 4 commits
    • David Howells's avatar
      mtd: Provide fs_context-aware mount_mtd() replacement · 0f071004
      David Howells authored
      Provide a function, get_tree_mtd(), to replace mount_mtd(), using an
      fs_context struct to hold the parameters.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: David Woodhouse <dwmw2@infradead.org>
      cc: Brian Norris <computersforpeace@gmail.com>
      cc: Boris Brezillon <bbrezillon@kernel.org>
      cc: Marek Vasut <marek.vasut@gmail.com>
      cc: Richard Weinberger <richard@nod.at>
      cc: linux-mtd@lists.infradead.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      0f071004
    • David Howells's avatar
      vfs: Create fs_context-aware mount_bdev() replacement · fe62c3a4
      David Howells authored
      Create a function, get_tree_bdev(), that is fs_context-aware and a
      ->get_tree() counterpart of mount_bdev().
      
      It caches the block device pointer in the fs_context struct so that this
      information can be passed into sget_fc()'s test and set functions.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      cc: Jens Axboe <axboe@kernel.dk>
      cc: linux-block@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      fe62c3a4
    • Al Viro's avatar
      new helper: get_tree_keyed() · 533770cc
      Al Viro authored
      For vfs_get_keyed_super users.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      533770cc
    • Eric Biggers's avatar
      vfs: set fs_context::user_ns for reconfigure · 1dd9bc08
      Eric Biggers authored
      fs_context::user_ns is used by fuse_parse_param(), even during remount,
      so it needs to be set to the existing value for reconfigure.
      
      Reproducer:
      
      	#include <fcntl.h>
      	#include <sys/mount.h>
      
      	int main()
      	{
      		char opts[128];
      		int fd = open("/dev/fuse", O_RDWR);
      
      		sprintf(opts, "fd=%d,rootmode=040000,user_id=0,group_id=0", fd);
      		mkdir("mnt", 0777);
      		mount("foo",  "mnt", "fuse.foo", 0, opts);
      		mount("foo", "mnt", "fuse.foo", MS_REMOUNT, opts);
      	}
      
      Crash:
      	BUG: kernel NULL pointer dereference, address: 0000000000000000
      	#PF: supervisor read access in kernel mode
      	#PF: error_code(0x0000) - not-present page
      	PGD 0 P4D 0
      	Oops: 0000 [#1] SMP
      	CPU: 0 PID: 129 Comm: syz_make_kuid Not tainted 5.3.0-rc5-next-20190821 #3
      	Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-20181126_142135-anatol 04/01/2014
      	RIP: 0010:map_id_range_down+0xb/0xc0 kernel/user_namespace.c:291
      	[...]
      	Call Trace:
      	 map_id_down kernel/user_namespace.c:312 [inline]
      	 make_kuid+0xe/0x10 kernel/user_namespace.c:389
      	 fuse_parse_param+0x116/0x210 fs/fuse/inode.c:523
      	 vfs_parse_fs_param+0xdb/0x1b0 fs/fs_context.c:145
      	 vfs_parse_fs_string+0x6a/0xa0 fs/fs_context.c:188
      	 generic_parse_monolithic+0x85/0xc0 fs/fs_context.c:228
      	 parse_monolithic_mount_data+0x1b/0x20 fs/fs_context.c:708
      	 do_remount fs/namespace.c:2525 [inline]
      	 do_mount+0x39a/0xa60 fs/namespace.c:3107
      	 ksys_mount+0x7d/0xd0 fs/namespace.c:3325
      	 __do_sys_mount fs/namespace.c:3339 [inline]
      	 __se_sys_mount fs/namespace.c:3336 [inline]
      	 __x64_sys_mount+0x20/0x30 fs/namespace.c:3336
      	 do_syscall_64+0x4a/0x1a0 arch/x86/entry/common.c:290
      	 entry_SYSCALL_64_after_hwframe+0x49/0xbe
      
      Reported-by: syzbot+7d6a57304857423318a5@syzkaller.appspotmail.com
      Fixes: 408cbe695350 ("vfs: Convert fuse to use the new mount API")
      Cc: David Howells <dhowells@redhat.com>
      Cc: Miklos Szeredi <miklos@szeredi.hu>
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Reviewed-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      1dd9bc08
  5. 02 Sep, 2019 1 commit