1. 10 Sep, 2019 25 commits
  2. 06 Sep, 2019 3 commits
  3. 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
  4. 02 Sep, 2019 3 commits
    • Miklos Szeredi's avatar
      cuse: fix broken release · 56d250ef
      Miklos Szeredi authored
      The inode parameter in cuse_release() is likely *not* a fuse inode.  It's a
      small wonder it didn't blow up until now.
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      56d250ef
    • Maxim Patlasov's avatar
      fuse: cleanup fuse_wait_on_page_writeback · 17b2cbe2
      Maxim Patlasov authored
      fuse_wait_on_page_writeback() always returns zero and nobody cares.
      Let's make it void.
      Signed-off-by: default avatarMaxim Patlasov <mpatlasov@virtuozzo.com>
      Signed-off-by: default avatarVasily Averin <vvs@virtuozzo.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      17b2cbe2
    • Kirill Smelkov's avatar
      fuse: require /dev/fuse reads to have enough buffer capacity (take 2) · 1fb027d7
      Kirill Smelkov authored
      [ This retries commit d4b13963 ("fuse: require /dev/fuse reads to have
      enough buffer capacity"), which was reverted.  In this version we require
      only `sizeof(fuse_in_header) + sizeof(fuse_write_in)` instead of 4K for
      FUSE request header room, because, contrary to libfuse and kernel client
      behaviour, GlusterFS actually provides only so much room for request
      header. ]
      
      A FUSE filesystem server queues /dev/fuse sys_read calls to get filesystem
      requests to handle. It does not know in advance what would be that request
      as it can be anything that client issues - LOOKUP, READ, WRITE, ... Many
      requests are short and retrieve data from the filesystem. However WRITE and
      NOTIFY_REPLY write data into filesystem.
      
      Before getting into operation phase, FUSE filesystem server and kernel
      client negotiate what should be the maximum write size the client will ever
      issue. After negotiation the contract in between server/client is that the
      filesystem server then should queue /dev/fuse sys_read calls with enough
      buffer capacity to receive any client request - WRITE in particular, while
      FUSE client should not, in particular, send WRITE requests with >
      negotiated max_write payload. FUSE client in kernel and libfuse
      historically reserve 4K for request header. However an existing filesystem
      server - GlusterFS - was found which reserves only 80 bytes for header room
      (= `sizeof(fuse_in_header) + sizeof(fuse_write_in)`).
      
      Since
      
      	`sizeof(fuse_in_header) + sizeof(fuse_write_in)` ==
      	`sizeof(fuse_in_header) + sizeof(fuse_read_in)`  ==
      	`sizeof(fuse_in_header) + sizeof(fuse_notify_retrieve_in)`
      
      is the absolute minimum any sane filesystem should be using for header
      room, the contract is that filesystem server should queue sys_reads with
      `sizeof(fuse_in_header) + sizeof(fuse_write_in)` + max_write buffer.
      
      If the filesystem server does not follow this contract, what can happen
      is that fuse_dev_do_read will see that request size is > buffer size,
      and then it will return EIO to client who issued the request but won't
      indicate in any way that there is a problem to filesystem server.
      This can be hard to diagnose because for some requests, e.g. for
      NOTIFY_REPLY which mimics WRITE, there is no client thread that is
      waiting for request completion and that EIO goes nowhere, while on
      filesystem server side things look like the kernel is not replying back
      after successful NOTIFY_RETRIEVE request made by the server.
      
      We can make the problem easy to diagnose if we indicate via error return to
      filesystem server when it is violating the contract.  This should not
      practically cause problems because if a filesystem server is using shorter
      buffer, writes to it were already very likely to cause EIO, and if the
      filesystem is read-only it should be too following FUSE_MIN_READ_BUFFER
      minimum buffer size.
      
      Please see [1] for context where the problem of stuck filesystem was hit
      for real (because kernel client was incorrectly sending more than
      max_write data with NOTIFY_REPLY; see also previous patch), how the
      situation was traced and for more involving patch that did not make it
      into the tree.
      
      [1] https://marc.info/?l=linux-fsdevel&m=155057023600853&w=2Signed-off-by: Kirill Smelkov's avatarKirill Smelkov <kirr@nexedi.com>
      Tested-by: default avatarSander Eikelenboom <linux@eikelenboom.it>
      Cc: Han-Wen Nienhuys <hanwen@google.com>
      Cc: Jakob Unterwurzacher <jakobunt@gmail.com>
      Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
      1fb027d7
  5. 25 Aug, 2019 5 commits
    • Linus Torvalds's avatar
      Linux 5.3-rc6 · a55aa89a
      Linus Torvalds authored
      a55aa89a
    • Linus Torvalds's avatar
      Merge tag 'auxdisplay-for-linus-v5.3-rc7' of git://github.com/ojeda/linux · c749088f
      Linus Torvalds authored
      Pull auxdisplay cleanup from Miguel Ojeda:
       "Make ht16k33_fb_fix and ht16k33_fb_var constant (Nishka Dasgupta)"
      
      * tag 'auxdisplay-for-linus-v5.3-rc7' of git://github.com/ojeda/linux:
        auxdisplay: ht16k33: Make ht16k33_fb_fix and ht16k33_fb_var constant
      c749088f
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml · 32ae83ff
      Linus Torvalds authored
      Pull UML fix from Richard Weinberger:
       "Fix time travel mode"
      
      * tag 'for-linus-5.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
        um: fix time travel mode
      32ae83ff
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs · 94a76d9b
      Linus Torvalds authored
      Pull UBIFS and JFFS2 fixes from Richard Weinberger:
       "UBIFS:
         - Don't block too long in writeback_inodes_sb()
         - Fix for a possible overrun of the log head
         - Fix double unlock in orphan_delete()
      
        JFFS2:
         - Remove C++ style from UAPI header and unbreak picky toolchains"
      
      * tag 'for-linus-5.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/ubifs:
        ubifs: Limit the number of pages in shrink_liability
        ubifs: Correctly initialize c->min_log_bytes
        ubifs: Fix double unlock around orphan_delete()
        jffs2: Remove C++ style comments from uapi header
      94a76d9b
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 146c3d32
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A few fixes for x86:
      
         - Fix a boot regression caused by the recent bootparam sanitizing
           change, which escaped the attention of all people who reviewed that
           code.
      
         - Address a boot problem on machines with broken E820 tables caused
           by an underflow which ended up placing the trampoline start at
           physical address 0.
      
         - Handle machines which do not advertise a legacy timer of any form,
           but need calibration of the local APIC timer gracefully by making
           the calibration routine independent from the tick interrupt. Marked
           for stable as well as there seems to be quite some new laptops
           rolled out which expose this.
      
         - Clear the RDRAND CPUID bit on AMD family 15h and 16h CPUs which are
           affected by broken firmware which does not initialize RDRAND
           correctly after resume. Add a command line parameter to override
           this for machine which either do not use suspend/resume or have a
           fixed BIOS. Unfortunately there is no way to detect this on boot,
           so the only safe decision is to turn it off by default.
      
         - Prevent RFLAGS from being clobbers in CALL_NOSPEC on 32bit which
           caused fast KVM instruction emulation to break.
      
         - Explain the Intel CPU model naming convention so that the repeating
           discussions come to an end"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/retpoline: Don't clobber RFLAGS during CALL_NOSPEC on i386
        x86/boot: Fix boot regression caused by bootparam sanitizing
        x86/CPU/AMD: Clear RDRAND CPUID bit on AMD family 15h/16h
        x86/boot/compressed/64: Fix boot on machines with broken E820 table
        x86/apic: Handle missing global clockevent gracefully
        x86/cpu: Explain Intel model naming convention
      146c3d32