20 Sep, 2020

1 commit

  • Commit 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler")
    changed ctl_table.proc_handler to take a kernel pointer. Adjust the
    definition of dirtytime_interval_handler to match its prototype in
    linux/writeback.h which fixes the following sparse error/warning:

    fs/fs-writeback.c:2189:50: warning: incorrect type in argument 3 (different address spaces)
    fs/fs-writeback.c:2189:50: expected void *
    fs/fs-writeback.c:2189:50: got void [noderef] __user *buffer
    fs/fs-writeback.c:2184:5: error: symbol 'dirtytime_interval_handler' redeclared with different type (incompatible argument 3 (different address spaces)):
    fs/fs-writeback.c:2184:5: int extern [addressable] [signed] [toplevel] dirtytime_interval_handler( ... )
    fs/fs-writeback.c: note: in included file:
    ./include/linux/writeback.h:374:5: note: previously declared as:
    ./include/linux/writeback.h:374:5: int extern [addressable] [signed] [toplevel] dirtytime_interval_handler( ... )

    Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler")
    Signed-off-by: Tobias Klauser
    Signed-off-by: Andrew Morton
    Reviewed-by: Jan Kara
    Cc: Christoph Hellwig
    Cc: Al Viro
    Link: https://lkml.kernel.org/r/20200907093140.13434-1-tklauser@distanz.ch
    Signed-off-by: Linus Torvalds

    Tobias Klauser
     

15 Sep, 2020

1 commit


14 Sep, 2020

2 commits

  • When faulting in the pages for the user supplied buffer for the search
    ioctl, we are passing only the base address of the buffer to the function
    fault_in_pages_writeable(). This means that after the first iteration of
    the while loop that searches for leaves, when we have a non-zero offset,
    stored in 'sk_offset', we try to fault in a wrong page range.

    So fix this by adding the offset in 'sk_offset' to the base address of the
    user supplied buffer when calling fault_in_pages_writeable().

    Several users have reported that the applications compsize and bees have
    started to operate incorrectly since commit a48b73eca4ceb9 ("btrfs: fix
    potential deadlock in the search ioctl") was added to stable trees, and
    these applications make heavy use of the search ioctls. This fixes their
    issues.

    Link: https://lore.kernel.org/linux-btrfs/632b888d-a3c3-b085-cdf5-f9bb61017d92@lechevalier.se/
    Link: https://github.com/kilobyte/compsize/issues/34
    Fixes: a48b73eca4ceb9 ("btrfs: fix potential deadlock in the search ioctl")
    CC: stable@vger.kernel.org # 4.4+
    Tested-by: A L
    Reviewed-by: Josef Bacik
    Signed-off-by: Filipe Manana
    Reviewed-by: David Sterba
    Signed-off-by: David Sterba

    Filipe Manana
     
  • Pull driver core fixes from Greg KH:
    "Here are some small driver core and debugfs fixes for 5.9-rc5

    Included in here are:

    - firmware loader memory leak fix

    - firmware loader testing fixes for non-EFI systems

    - device link locking fixes found by lockdep

    - kobject_del() bugfix that has been affecting some callers

    - debugfs minor fix

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'driver-core-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
    test_firmware: Test platform fw loading on non-EFI systems
    PM: : fix @em_pd kernel-doc warning
    kobject: Drop unneeded conditional in __kobject_del()
    driver core: Fix device_pm_lock() locking for device links
    MAINTAINERS: Add the security document to SECURITY CONTACT
    driver code: print symbolic error code
    debugfs: Fix module state check condition
    kobject: Restore old behaviour of kobject_del(NULL)
    firmware_loader: fix memory leak for paged buffer

    Linus Torvalds
     

13 Sep, 2020

2 commits

  • Pull btrfs fixes from David Sterba:
    "A few more fixes:

    - regression fix for a crash after failed snapshot creation

    - one more lockep fix: use nofs allocation when allocating missing
    device

    - fix reloc tree leak on degraded mount

    - make some extent buffer alignment checks less strict to mount
    filesystems created by btrfs-convert"

    * tag 'for-5.9-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
    btrfs: fix NULL pointer dereference after failure to create snapshot
    btrfs: free data reloc tree on failed mount
    btrfs: require only sector size alignment for parent eb bytenr
    btrfs: fix lockdep splat in add_missing_dev

    Linus Torvalds
     
  • Pull cifs fix from Steve French:
    "A fix for lookup on DFS link when cifsacl or modefromsid is used"

    * tag '5.9-rc4-smb3-fix' of git://git.samba.org/sfrench/cifs-2.6:
    cifs: fix DFS mount with cifsacl/modefromsid

    Linus Torvalds
     

11 Sep, 2020

1 commit


10 Sep, 2020

1 commit

  • Pull NFS client bugfixes from Trond Myklebust:

    - Fix an NFS/RDMA resource leak

    - Fix the error handling during delegation recall

    - NFSv4.0 needs to return the delegation on a zero-stateid SETATTR

    - Stop printk reading past end of string

    * tag 'nfs-for-5.9-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
    SUNRPC: stop printk reading past end of string
    NFS: Zero-stateid SETATTR should first return delegation
    NFSv4.1 handle ERR_DELAY error reclaiming locking state on delegation recall
    xprtrdma: Release in-flight MRs on disconnect

    Linus Torvalds
     

09 Sep, 2020

3 commits

  • Reading past end of file returns EOF for aligned reads but -EINVAL for
    unaligned reads on f2fs. While documentation is not strict about this
    corner case, most filesystem returns EOF on this case, like iomap
    filesystems. This patch consolidates the behavior for f2fs, by making
    it return EOF(0).

    it can be verified by a read loop on a file that does a partial read
    before EOF (A file that doesn't end at an aligned address). The
    following code fails on an unaligned file on f2fs, but not on
    btrfs, ext4, and xfs.

    while (done < total) {
    ssize_t delta = pread(fd, buf + done, total - done, off + done);
    if (!delta)
    break;
    ...
    }

    It is arguable whether filesystems should actually return EOF or
    -EINVAL, but since iomap filesystems support it, and so does the
    original DIO code, it seems reasonable to consolidate on that.

    Signed-off-by: Gabriel Krisman Bertazi
    Reviewed-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Gabriel Krisman Bertazi
     
  • If the sbi->ckpt->next_free_nid is not NAT block aligned and if there
    are free nids in that NAT block between the start of the block and
    next_free_nid, then those free nids will not be scanned in scan_nat_page().
    This results into mismatch between nm_i->available_nids and the sum of
    nm_i->free_nid_count of all NAT blocks scanned. And nm_i->available_nids
    will always be greater than the sum of free nids in all the blocks.
    Under this condition, if we use all the currently scanned free nids,
    then it will loop forever in f2fs_alloc_nid() as nm_i->available_nids
    is still not zero but nm_i->free_nid_count of that partially scanned
    NAT block is zero.

    Fix this to align the nm_i->next_scan_nid to the first nid of the
    corresponding NAT block.

    Signed-off-by: Sahitya Tummala
    Reviewed-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Sahitya Tummala
     
  • Commit da52f8ade40b ("f2fs: get the right gc victim section when section
    has several segments") added code to count blocks of each section using
    variables with type 'unsigned short', which has 2 bytes size in many
    systems. However, the counts can be larger than the 2 bytes range and
    type conversion results in wrong values. Especially when the f2fs
    sections have blocks as many as USHRT_MAX + 1, the count is handled as 0.
    This triggers eternal loop in init_dirty_segmap() at mount system call.
    Fix this by changing the type of the variables to block_t.

    Fixes: da52f8ade40b ("f2fs: get the right gc victim section when section has several segments")
    Signed-off-by: Shin'ichiro Kawasaki
    Reviewed-by: Chao Yu
    Signed-off-by: Jaegeuk Kim

    Shin'ichiro Kawasaki
     

08 Sep, 2020

1 commit

  • When trying to get a new fs root for a snapshot during the transaction
    at transaction.c:create_pending_snapshot(), if btrfs_get_new_fs_root()
    fails we leave "pending->snap" pointing to an error pointer, and then
    later at ioctl.c:create_snapshot() we dereference that pointer, resulting
    in a crash:

    [12264.614689] BUG: kernel NULL pointer dereference, address: 00000000000007c4
    [12264.615650] #PF: supervisor write access in kernel mode
    [12264.616487] #PF: error_code(0x0002) - not-present page
    [12264.617436] PGD 0 P4D 0
    [12264.618328] Oops: 0002 [#1] PREEMPT SMP DEBUG_PAGEALLOC PTI
    [12264.619150] CPU: 0 PID: 2310635 Comm: fsstress Tainted: G W 5.9.0-rc3-btrfs-next-67 #1
    [12264.619960] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014
    [12264.621769] RIP: 0010:btrfs_mksubvol+0x438/0x4a0 [btrfs]
    [12264.622528] Code: bc ef ff ff (...)
    [12264.624092] RSP: 0018:ffffaa6fc7277cd8 EFLAGS: 00010282
    [12264.624669] RAX: 00000000fffffff4 RBX: ffff9d3e8f151a60 RCX: 0000000000000000
    [12264.625249] RDX: 0000000000000001 RSI: ffffffff9d56c9be RDI: fffffffffffffff4
    [12264.625830] RBP: ffff9d3e8f151b48 R08: 0000000000000000 R09: 0000000000000000
    [12264.626413] R10: 0000000000000000 R11: 0000000000000000 R12: 00000000fffffff4
    [12264.626994] R13: ffff9d3ede380538 R14: ffff9d3ede380500 R15: ffff9d3f61b2eeb8
    [12264.627582] FS: 00007f140d5d8200(0000) GS:ffff9d3fb5e00000(0000) knlGS:0000000000000000
    [12264.628176] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [12264.628773] CR2: 00000000000007c4 CR3: 000000020f8e8004 CR4: 00000000003706f0
    [12264.629379] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [12264.629994] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    [12264.630594] Call Trace:
    [12264.631227] btrfs_mksnapshot+0x7b/0xb0 [btrfs]
    [12264.631840] __btrfs_ioctl_snap_create+0x16f/0x1a0 [btrfs]
    [12264.632458] btrfs_ioctl_snap_create_v2+0xb0/0xf0 [btrfs]
    [12264.633078] btrfs_ioctl+0x1864/0x3130 [btrfs]
    [12264.633689] ? do_sys_openat2+0x1a7/0x2d0
    [12264.634295] ? kmem_cache_free+0x147/0x3a0
    [12264.634899] ? __x64_sys_ioctl+0x83/0xb0
    [12264.635488] __x64_sys_ioctl+0x83/0xb0
    [12264.636058] do_syscall_64+0x33/0x80
    [12264.636616] entry_SYSCALL_64_after_hwframe+0x44/0xa9

    (gdb) list *(btrfs_mksubvol+0x438)
    0x7c7b8 is in btrfs_mksubvol (fs/btrfs/ioctl.c:858).
    853 ret = 0;
    854 pending_snapshot->anon_dev = 0;
    855 fail:
    856 /* Prevent double freeing of anon_dev */
    857 if (ret && pending_snapshot->snap)
    858 pending_snapshot->snap->anon_dev = 0;
    859 btrfs_put_root(pending_snapshot->snap);
    860 btrfs_subvolume_release_metadata(root, &pending_snapshot->block_rsv);
    861 free_pending:
    862 if (pending_snapshot->anon_dev)

    So fix this by setting "pending->snap" to NULL if we get an error from the
    call to btrfs_get_new_fs_root() at transaction.c:create_pending_snapshot().

    Fixes: 2dfb1e43f57dd3 ("btrfs: preallocate anon block device at first phase of snapshot creation")
    Signed-off-by: Filipe Manana
    Reviewed-by: David Sterba
    Signed-off-by: David Sterba

    Filipe Manana
     

07 Sep, 2020

5 commits

  • While testing a weird problem with -o degraded, I noticed I was getting
    leaked root errors

    BTRFS warning (device loop0): writable mount is not allowed due to too many missing devices
    BTRFS error (device loop0): open_ctree failed
    BTRFS error (device loop0): leaked root -9-0 refcount 1

    This is the DATA_RELOC root, which gets read before the other fs roots,
    but is included in the fs roots radix tree. Handle this by adding a
    btrfs_drop_and_free_fs_root() on the data reloc root if it exists. This
    is ok to do here if we fail further up because we will only drop the ref
    if we delete the root from the radix tree, and all other cleanup won't
    be duplicated.

    CC: stable@vger.kernel.org # 5.8+
    Reviewed-by: Nikolay Borisov
    Signed-off-by: Josef Bacik
    Reviewed-by: David Sterba
    Signed-off-by: David Sterba

    Josef Bacik
     
  • [BUG]
    A completely sane converted fs will cause kernel warning at balance
    time:

    [ 1557.188633] BTRFS info (device sda7): relocating block group 8162107392 flags data
    [ 1563.358078] BTRFS info (device sda7): found 11722 extents
    [ 1563.358277] BTRFS info (device sda7): leaf 7989321728 gen 95 total ptrs 213 free space 3458 owner 2
    [ 1563.358280] item 0 key (7984947200 169 0) itemoff 16250 itemsize 33
    [ 1563.358281] extent refs 1 gen 90 flags 2
    [ 1563.358282] ref#0: tree block backref root 4
    [ 1563.358285] item 1 key (7985602560 169 0) itemoff 16217 itemsize 33
    [ 1563.358286] extent refs 1 gen 93 flags 258
    [ 1563.358287] ref#0: shared block backref parent 7985602560
    [ 1563.358288] (parent 7985602560 is NOT ALIGNED to nodesize 16384)
    [ 1563.358290] item 2 key (7985635328 169 0) itemoff 16184 itemsize 33
    ...
    [ 1563.358995] BTRFS error (device sda7): eb 7989321728 invalid extent inline ref type 182
    [ 1563.358996] ------------[ cut here ]------------
    [ 1563.359005] WARNING: CPU: 14 PID: 2930 at 0xffffffff9f231766

    Then with transaction abort, and obviously failed to balance the fs.

    [CAUSE]
    That mentioned inline ref type 182 is completely sane, it's
    BTRFS_SHARED_BLOCK_REF_KEY, it's some extra check making kernel to
    believe it's invalid.

    Commit 64ecdb647ddb ("Btrfs: add one more sanity check for shared ref
    type") introduced extra checks for backref type.

    One of the requirement is, parent bytenr must be aligned to node size,
    which is not correct.

    One example is like this:

    0 1G 1G+4K 2G 2G+4K
    | |///////////////////|//|
    Signed-off-by: Qu Wenruo
    [ update comments and messages ]
    Signed-off-by: David Sterba

    Qu Wenruo
     
  • Nikolay reported a lockdep splat in generic/476 that I could reproduce
    with btrfs/187.

    ======================================================
    WARNING: possible circular locking dependency detected
    5.9.0-rc2+ #1 Tainted: G W
    ------------------------------------------------------
    kswapd0/100 is trying to acquire lock:
    ffff9e8ef38b6268 (&delayed_node->mutex){+.+.}-{3:3}, at: __btrfs_release_delayed_node.part.0+0x3f/0x330

    but task is already holding lock:
    ffffffffa9d74700 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x5/0x30

    which lock already depends on the new lock.

    the existing dependency chain (in reverse order) is:

    -> #2 (fs_reclaim){+.+.}-{0:0}:
    fs_reclaim_acquire+0x65/0x80
    slab_pre_alloc_hook.constprop.0+0x20/0x200
    kmem_cache_alloc_trace+0x3a/0x1a0
    btrfs_alloc_device+0x43/0x210
    add_missing_dev+0x20/0x90
    read_one_chunk+0x301/0x430
    btrfs_read_sys_array+0x17b/0x1b0
    open_ctree+0xa62/0x1896
    btrfs_mount_root.cold+0x12/0xea
    legacy_get_tree+0x30/0x50
    vfs_get_tree+0x28/0xc0
    vfs_kern_mount.part.0+0x71/0xb0
    btrfs_mount+0x10d/0x379
    legacy_get_tree+0x30/0x50
    vfs_get_tree+0x28/0xc0
    path_mount+0x434/0xc00
    __x64_sys_mount+0xe3/0x120
    do_syscall_64+0x33/0x40
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

    -> #1 (&fs_info->chunk_mutex){+.+.}-{3:3}:
    __mutex_lock+0x7e/0x7e0
    btrfs_chunk_alloc+0x125/0x3a0
    find_free_extent+0xdf6/0x1210
    btrfs_reserve_extent+0xb3/0x1b0
    btrfs_alloc_tree_block+0xb0/0x310
    alloc_tree_block_no_bg_flush+0x4a/0x60
    __btrfs_cow_block+0x11a/0x530
    btrfs_cow_block+0x104/0x220
    btrfs_search_slot+0x52e/0x9d0
    btrfs_lookup_inode+0x2a/0x8f
    __btrfs_update_delayed_inode+0x80/0x240
    btrfs_commit_inode_delayed_inode+0x119/0x120
    btrfs_evict_inode+0x357/0x500
    evict+0xcf/0x1f0
    vfs_rmdir.part.0+0x149/0x160
    do_rmdir+0x136/0x1a0
    do_syscall_64+0x33/0x40
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

    -> #0 (&delayed_node->mutex){+.+.}-{3:3}:
    __lock_acquire+0x1184/0x1fa0
    lock_acquire+0xa4/0x3d0
    __mutex_lock+0x7e/0x7e0
    __btrfs_release_delayed_node.part.0+0x3f/0x330
    btrfs_evict_inode+0x24c/0x500
    evict+0xcf/0x1f0
    dispose_list+0x48/0x70
    prune_icache_sb+0x44/0x50
    super_cache_scan+0x161/0x1e0
    do_shrink_slab+0x178/0x3c0
    shrink_slab+0x17c/0x290
    shrink_node+0x2b2/0x6d0
    balance_pgdat+0x30a/0x670
    kswapd+0x213/0x4c0
    kthread+0x138/0x160
    ret_from_fork+0x1f/0x30

    other info that might help us debug this:

    Chain exists of:
    &delayed_node->mutex --> &fs_info->chunk_mutex --> fs_reclaim

    Possible unsafe locking scenario:

    CPU0 CPU1
    ---- ----
    lock(fs_reclaim);
    lock(&fs_info->chunk_mutex);
    lock(fs_reclaim);
    lock(&delayed_node->mutex);

    *** DEADLOCK ***

    3 locks held by kswapd0/100:
    #0: ffffffffa9d74700 (fs_reclaim){+.+.}-{0:0}, at: __fs_reclaim_acquire+0x5/0x30
    #1: ffffffffa9d65c50 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x115/0x290
    #2: ffff9e8e9da260e0 (&type->s_umount_key#48){++++}-{3:3}, at: super_cache_scan+0x38/0x1e0

    stack backtrace:
    CPU: 1 PID: 100 Comm: kswapd0 Tainted: G W 5.9.0-rc2+ #1
    Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014
    Call Trace:
    dump_stack+0x92/0xc8
    check_noncircular+0x12d/0x150
    __lock_acquire+0x1184/0x1fa0
    lock_acquire+0xa4/0x3d0
    ? __btrfs_release_delayed_node.part.0+0x3f/0x330
    __mutex_lock+0x7e/0x7e0
    ? __btrfs_release_delayed_node.part.0+0x3f/0x330
    ? __btrfs_release_delayed_node.part.0+0x3f/0x330
    ? lock_acquire+0xa4/0x3d0
    ? btrfs_evict_inode+0x11e/0x500
    ? find_held_lock+0x2b/0x80
    __btrfs_release_delayed_node.part.0+0x3f/0x330
    btrfs_evict_inode+0x24c/0x500
    evict+0xcf/0x1f0
    dispose_list+0x48/0x70
    prune_icache_sb+0x44/0x50
    super_cache_scan+0x161/0x1e0
    do_shrink_slab+0x178/0x3c0
    shrink_slab+0x17c/0x290
    shrink_node+0x2b2/0x6d0
    balance_pgdat+0x30a/0x670
    kswapd+0x213/0x4c0
    ? _raw_spin_unlock_irqrestore+0x46/0x60
    ? add_wait_queue_exclusive+0x70/0x70
    ? balance_pgdat+0x670/0x670
    kthread+0x138/0x160
    ? kthread_create_worker_on_cpu+0x40/0x40
    ret_from_fork+0x1f/0x30

    This is because we are holding the chunk_mutex when we call
    btrfs_alloc_device, which does a GFP_KERNEL allocation. We don't want
    to switch that to a GFP_NOFS lock because this is the only place where
    it matters. So instead use memalloc_nofs_save() around the allocation
    in order to avoid the lockdep splat.

    Reported-by: Nikolay Borisov
    CC: stable@vger.kernel.org # 4.4+
    Reviewed-by: Anand Jain
    Signed-off-by: Josef Bacik
    Reviewed-by: David Sterba
    Signed-off-by: David Sterba

    Josef Bacik
     
  • RHBZ: 1871246

    If during cifs_lookup()/get_inode_info() we encounter a DFS link
    and we use the cifsacl or modefromsid mount options we must suppress
    any -EREMOTE errors that triggers or else we will not be able to follow
    the DFS link and automount the target.

    This fixes an issue with modefromsid/cifsacl where these mountoptions
    would break DFS and we would no longer be able to access the share.

    Signed-off-by: Ronnie Sahlberg
    Reviewed-by: Paulo Alcantara (SUSE)
    Signed-off-by: Steve French

    Ronnie Sahlberg
     
  • Pull more io_uring fixes from Jens Axboe:
    "Two followup fixes. One is fixing a regression from this merge window,
    the other is two commits fixing cancelation of deferred requests.

    Both have gone through full testing, and both spawned a few new
    regression test additions to liburing.

    - Don't play games with const, properly store the output iovec and
    assign it as needed.

    - Deferred request cancelation fix (Pavel)"

    * tag 'io_uring-5.9-2020-09-06' of git://git.kernel.dk/linux-block:
    io_uring: fix linked deferred ->files cancellation
    io_uring: fix cancel of deferred reqs with ->files
    io_uring: fix explicit async read/write mapping for large segments

    Linus Torvalds
     

06 Sep, 2020

5 commits

  • While looking for ->files in ->defer_list, consider that requests there
    may actually be links.

    Signed-off-by: Pavel Begunkov
    Signed-off-by: Jens Axboe

    Pavel Begunkov
     
  • While trying to cancel requests with ->files, it also should look for
    requests in ->defer_list, otherwise it might end up hanging a thread.

    Cancel all requests in ->defer_list up to the last request there with
    matching ->files, that's needed to follow drain ordering semantics.

    Signed-off-by: Pavel Begunkov
    Signed-off-by: Jens Axboe

    Pavel Begunkov
     
  • Pull xfs fix from Darrick Wong:
    "Fix a broken metadata verifier that would incorrectly validate attr
    fork extents of a realtime file against the realtime volume"

    * tag 'xfs-5.9-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
    xfs: fix xfs_bmap_validate_extent_raw when checking attr fork of rt files

    Linus Torvalds
     
  • When running in a dax mode, if the user maps a page with MAP_PRIVATE and
    PROT_WRITE, the xfs filesystem would incorrectly update ctime and mtime
    when the user hits a COW fault.

    This breaks building of the Linux kernel. How to reproduce:

    1. extract the Linux kernel tree on dax-mounted xfs filesystem
    2. run make clean
    3. run make -j12
    4. run make -j12

    at step 4, make would incorrectly rebuild the whole kernel (although it
    was already built in step 3).

    The reason for the breakage is that almost all object files depend on
    objtool. When we run objtool, it takes COW page fault on its .data
    section, and these faults will incorrectly update the timestamp of the
    objtool binary. The updated timestamp causes make to rebuild the whole
    tree.

    Signed-off-by: Mikulas Patocka
    Cc: stable@vger.kernel.org
    Signed-off-by: Linus Torvalds

    Mikulas Patocka
     
  • When running in a dax mode, if the user maps a page with MAP_PRIVATE and
    PROT_WRITE, the ext2 filesystem would incorrectly update ctime and mtime
    when the user hits a COW fault.

    This breaks building of the Linux kernel. How to reproduce:

    1. extract the Linux kernel tree on dax-mounted ext2 filesystem
    2. run make clean
    3. run make -j12
    4. run make -j12

    at step 4, make would incorrectly rebuild the whole kernel (although it
    was already built in step 3).

    The reason for the breakage is that almost all object files depend on
    objtool. When we run objtool, it takes COW page fault on its .data
    section, and these faults will incorrectly update the timestamp of the
    objtool binary. The updated timestamp causes make to rebuild the whole
    tree.

    Signed-off-by: Mikulas Patocka
    Cc: stable@vger.kernel.org
    Signed-off-by: Linus Torvalds

    Mikulas Patocka
     

05 Sep, 2020

4 commits

  • If we exceed UIO_FASTIOV, we don't handle the transition correctly
    between an allocated vec for requests that are queued with IOSQE_ASYNC.
    Store the iovec appropriately and re-set it in the iter iov in case
    it changed.

    Fixes: ff6165b2d7f6 ("io_uring: retain iov_iter state over io_read/io_write calls")
    Reported-by: Nick Hill
    Tested-by: Norman Maurer
    Signed-off-by: Jens Axboe

    Jens Axboe
     
  • If a write delegation isn't available, the Linux NFS client uses
    a zero-stateid when performing a SETATTR.

    NFSv4.0 provides no mechanism for an NFS server to match such a
    request to a particular client. It recalls all delegations for that
    file, even delegations held by the client issuing the request. If
    that client happens to hold a read delegation, the server will
    recall it immediately, resulting in an NFS4ERR_DELAY/CB_RECALL/
    DELEGRETURN sequence.

    Optimize out this pipeline bubble by having the client return any
    delegations it may hold on a file before it issues a
    SETATTR(zero-stateid) on that file.

    Signed-off-by: Chuck Lever
    Signed-off-by: Trond Myklebust

    Chuck Lever
     
  • Pull io_uring fixes from Jens Axboe:

    - EAGAIN with O_NONBLOCK retry fix

    - Two small fixes for registered files (Jiufei)

    * tag 'io_uring-5.9-2020-09-04' of git://git.kernel.dk/linux-block:
    io_uring: no read/write-retry on -EAGAIN error and O_NONBLOCK marked file
    io_uring: set table->files[i] to NULL when io_sqe_file_register failed
    io_uring: fix removing the wrong file in __io_sqe_files_update()

    Linus Torvalds
     
  • The '#ifdef MODULE' check in the original commit does not work as intended.
    The code under the check is not built at all if CONFIG_DEBUG_FS=y. Fix this
    by using a correct check.

    Fixes: 275678e7a9be ("debugfs: Check module state before warning in {full/open}_proxy_open()")
    Signed-off-by: Vladis Dronov
    Cc: stable
    Link: https://lore.kernel.org/r/20200811150129.53343-1-vdronov@redhat.com
    Signed-off-by: Greg Kroah-Hartman

    Vladis Dronov
     

04 Sep, 2020

1 commit

  • Pull networking fixes from David Miller:

    1) Use netif_rx_ni() when necessary in batman-adv stack, from Jussi
    Kivilinna.

    2) Fix loss of RTT samples in rxrpc, from David Howells.

    3) Memory leak in hns_nic_dev_probe(), from Dignhao Liu.

    4) ravb module cannot be unloaded, fix from Yuusuke Ashizuka.

    5) We disable BH for too lokng in sctp_get_port_local(), add a
    cond_resched() here as well, from Xin Long.

    6) Fix memory leak in st95hf_in_send_cmd, from Dinghao Liu.

    7) Out of bound access in bpf_raw_tp_link_fill_link_info(), from
    Yonghong Song.

    8) Missing of_node_put() in mt7530 DSA driver, from Sumera
    Priyadarsini.

    9) Fix crash in bnxt_fw_reset_task(), from Michael Chan.

    10) Fix geneve tunnel checksumming bug in hns3, from Yi Li.

    11) Memory leak in rxkad_verify_response, from Dinghao Liu.

    12) In tipc, don't use smp_processor_id() in preemptible context. From
    Tuong Lien.

    13) Fix signedness issue in mlx4 memory allocation, from Shung-Hsi Yu.

    14) Missing clk_disable_prepare() in gemini driver, from Dan Carpenter.

    15) Fix ABI mismatch between driver and firmware in nfp, from Louis
    Peens.

    * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (110 commits)
    net/smc: fix sock refcounting in case of termination
    net/smc: reset sndbuf_desc if freed
    net/smc: set rx_off for SMCR explicitly
    net/smc: fix toleration of fake add_link messages
    tg3: Fix soft lockup when tg3_reset_task() fails.
    doc: net: dsa: Fix typo in config code sample
    net: dp83867: Fix WoL SecureOn password
    nfp: flower: fix ABI mismatch between driver and firmware
    tipc: fix shutdown() of connectionless socket
    ipv6: Fix sysctl max for fib_multipath_hash_policy
    drivers/net/wan/hdlc: Change the default of hard_header_len to 0
    net: gemini: Fix another missing clk_disable_unprepare() in probe
    net: bcmgenet: fix mask check in bcmgenet_validate_flow()
    amd-xgbe: Add support for new port mode
    net: usb: dm9601: Add USB ID of Keenetic Plus DSL
    vhost: fix typo in error message
    net: ethernet: mlx4: Fix memory allocation in mlx4_buddy_init()
    pktgen: fix error message with wrong function name
    net: ethernet: ti: am65-cpsw: fix rmii 100Mbit link mode
    cxgb4: fix thermal zone device registration
    ...

    Linus Torvalds
     

03 Sep, 2020

5 commits


02 Sep, 2020

3 commits

  • epoll_loop_check_proc() can run into a file already committed to destruction;
    we can't grab a reference on those and don't need to add them to the set for
    reverse path check anyway.

    Tested-by: Marc Zyngier
    Fixes: a9ed4a6560b8 ("epoll: Keep a reference on files added to the check list")
    Signed-off-by: Al Viro

    Al Viro
     
  • While io_sqe_file_register() failed in __io_sqe_files_update(),
    table->files[i] still point to the original file which may freed
    soon, and that will trigger use-after-free problems.

    Cc: stable@vger.kernel.org
    Fixes: f3bd9dae3708 ("io_uring: fix memleak in __io_sqe_files_update()")
    Signed-off-by: Jiufei Xue
    Signed-off-by: Jens Axboe

    Jiufei Xue
     
  • Pull btrfs fixes from David Sterba:
    "Two small fixes and a bunch of lockdep fixes for warnings that show up
    with an upcoming tree locking update but are valid with current locks
    as well"

    * tag 'for-5.9-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
    btrfs: tree-checker: fix the error message for transid error
    btrfs: set the lockdep class for log tree extent buffers
    btrfs: set the correct lockdep class for new nodes
    btrfs: allocate scrub workqueues outside of locks
    btrfs: fix potential deadlock in the search ioctl
    btrfs: drop path before adding new uuid tree entry
    btrfs: block-group: fix free-space bitmap threshold

    Linus Torvalds
     

01 Sep, 2020

1 commit

  • Index here is already the position of the file in fixed_file_table, we
    should not use io_file_from_index() again to get it. Otherwise, the
    wrong file which still in use may be released unexpectedly.

    Cc: stable@vger.kernel.org # v5.6
    Fixes: 05f3fb3c5397 ("io_uring: avoid ring quiesce for fixed file set unregister and update")
    Signed-off-by: Jiufei Xue
    Signed-off-by: Jens Axboe

    Jiufei Xue
     

31 Aug, 2020

2 commits

  • The basic permission bits (protection bits in AmigaOS) have been broken
    in Linux' AFFS - it would only set bits, but never delete them.
    Also, contrary to the documentation, the Archived bit was not handled.

    Let's fix this for good, and set the bits such that Linux and classic
    AmigaOS can coexist in the most peaceful manner.

    Also, update the documentation to represent the current state of things.

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Cc: stable@vger.kernel.org
    Signed-off-by: Max Staudt
    Signed-off-by: David Sterba

    Max Staudt
     
  • Pull cfis fix from Steve French:
    "DFS fix for referral problem when using SMB1"

    * tag '5.9-rc2-smb-fix' of git://git.samba.org/sfrench/cifs-2.6:
    cifs: fix check of tcon dfs in smb1

    Linus Torvalds
     

30 Aug, 2020

1 commit

  • …el/git/gustavoars/linux

    Pull fallthrough fixes from Gustavo A. R. Silva:
    "Fix some minor issues introduced by the recent treewide fallthrough
    conversions:

    - Fix identation issue

    - Fix erroneous fallthrough annotation

    - Remove unnecessary fallthrough annotation

    - Fix code comment changed by fallthrough conversion"

    * tag 'fallthrough-fixes-5.9-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
    arm64/cpuinfo: Remove unnecessary fallthrough annotation
    media: dib0700: Fix identation issue in dib8096_set_param_override()
    afs: Remove erroneous fallthough annotation
    iio: dpot-dac: fix code comment in dpot_dac_read_raw()

    Linus Torvalds
     

29 Aug, 2020

1 commit

  • Pull io_uring fixes from Jens Axboe:
    "A few fixes in here, all based on reports and test cases from folks
    using it. Most of it is stable material as well:

    - Hashed work cancelation fix (Pavel)

    - poll wakeup signalfd fix

    - memlock accounting fix

    - nonblocking poll retry fix

    - ensure we never return -ERESTARTSYS for reads

    - ensure offset == -1 is consistent with preadv2() as documented

    - IOPOLL -EAGAIN handling fixes

    - remove useless task_work bounce for block based -EAGAIN retry"

    * tag 'io_uring-5.9-2020-08-28' of git://git.kernel.dk/linux-block:
    io_uring: don't bounce block based -EAGAIN retry off task_work
    io_uring: fix IOPOLL -EAGAIN retries
    io_uring: clear req->result on IOPOLL re-issue
    io_uring: make offset == -1 consistent with preadv2/pwritev2
    io_uring: ensure read requests go through -ERESTART* transformation
    io_uring: don't use poll handler if file can't be nonblocking read/written
    io_uring: fix imbalanced sqo_mm accounting
    io_uring: revert consumed iov_iter bytes on error
    io-wq: fix hang after cancelling pending hashed work
    io_uring: don't recurse on tsk->sighand->siglock with signalfd

    Linus Torvalds