Skip to content
  1. May 30, 2021
  2. May 27, 2021
    • Marco Elver's avatar
      io_uring: fix data race to avoid potential NULL-deref · b16ef427
      Marco Elver authored
      Commit ba5ef6dc ("io_uring: fortify tctx/io_wq cleanup") introduced
      setting tctx->io_wq to NULL a bit earlier. This has caused KCSAN to
      detect a data race between accesses to tctx->io_wq:
      
        write to 0xffff88811d8df330 of 8 bytes by task 3709 on cpu 1:
         io_uring_clean_tctx                  fs/io_uring.c:9042 [inline]
         __io_uring_cancel                    fs/io_uring.c:9136
         io_uring_files_cancel                include/linux/io_uring.h:16 [inline]
         do_exit                              kernel/exit.c:781
         do_group_exit                        kernel/exit.c:923
         get_signal                           kernel/signal.c:2835
         arch_do_signal_or_restart            arch/x86/kernel/signal.c:789
         handle_signal_work                   kernel/entry/common.c:147 [inline]
         exit_to_user_mode_loop               kernel/entry/common.c:171 [inline]
         ...
        read to 0xffff88811d8df330 of 8 bytes by task 6412 on cpu 0:
         io_uring_try_cancel_iowq             fs/io_uring.c:8911 [inline]
         io_uring_try_cancel_requests         fs/io_uring.c:8933
         io_ring_exit_work                    fs/io_uring.c:8736
         process_one_work                     kernel/workqueue.c:2276
         ...
      
      With the config used, KCSAN only reports data races with value changes:
      this implies that in the case here we also know that tctx->io_wq was
      non-NULL. Therefore, depending on interleaving, we may end up with:
      
                    [CPU 0]                 |        [CPU 1]
        io_uring_try_cancel_iowq()          | io_uring_clean_tctx()
          if (!tctx->io_wq) // false        |   ...
          ...                               |   tctx->io_wq = NULL
          io_wq_cancel_cb(tctx->io_wq, ...) |   ...
            -> NULL-deref                   |
      
      Note: It is likely that thus far we've gotten lucky and the compiler
      optimizes the double-read into a single read into a register -- but this
      is never guaranteed, and can easily change with a different config!
      
      Fix the data race by restoring the previous behaviour, where both
      setting io_wq to NULL and put of the wq are _serialized_ after
      concurrent io_uring_try_cancel_iowq() via acquisition of the uring_lock
      and removal of the node in io_uring_del_task_file().
      
      Fixes: ba5ef6dc
      
       ("io_uring: fortify tctx/io_wq cleanup")
      Suggested-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Reported-by: default avatar <syzbot+bf2b3d0435b9b728946c@syzkaller.appspotmail.com>
      Signed-off-by: default avatarMarco Elver <elver@google.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Link: https://lore.kernel.org/r/20210527092547.2656514-1-elver@google.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b16ef427
  3. May 26, 2021
    • Zqiang's avatar
      io-wq: Fix UAF when wakeup wqe in hash waitqueue · 3743c172
      Zqiang authored
      
      
      BUG: KASAN: use-after-free in __wake_up_common+0x637/0x650
      Read of size 8 at addr ffff8880304250d8 by task iou-wrk-28796/28802
      
      Call Trace:
       __dump_stack [inline]
       dump_stack+0x141/0x1d7
       print_address_description.constprop.0.cold+0x5b/0x2c6
       __kasan_report [inline]
       kasan_report.cold+0x7c/0xd8
       __wake_up_common+0x637/0x650
       __wake_up_common_lock+0xd0/0x130
       io_worker_handle_work+0x9dd/0x1790
       io_wqe_worker+0xb2a/0xd40
       ret_from_fork+0x1f/0x30
      
      Allocated by task 28798:
       kzalloc_node [inline]
       io_wq_create+0x3c4/0xdd0
       io_init_wq_offload [inline]
       io_uring_alloc_task_context+0x1bf/0x6b0
       __io_uring_add_task_file+0x29a/0x3c0
       io_uring_add_task_file [inline]
       io_uring_install_fd [inline]
       io_uring_create [inline]
       io_uring_setup+0x209a/0x2bd0
       do_syscall_64+0x3a/0xb0
       entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Freed by task 28798:
       kfree+0x106/0x2c0
       io_wq_destroy+0x182/0x380
       io_wq_put [inline]
       io_wq_put_and_exit+0x7a/0xa0
       io_uring_clean_tctx [inline]
       __io_uring_cancel+0x428/0x530
       io_uring_files_cancel
       do_exit+0x299/0x2a60
       do_group_exit+0x125/0x310
       get_signal+0x47f/0x2150
       arch_do_signal_or_restart+0x2a8/0x1eb0
       handle_signal_work[inline]
       exit_to_user_mode_loop [inline]
       exit_to_user_mode_prepare+0x171/0x280
       __syscall_exit_to_user_mode_work [inline]
       syscall_exit_to_user_mode+0x19/0x60
       do_syscall_64+0x47/0xb0
       entry_SYSCALL_64_after_hwframe
      
      There are the following scenarios, hash waitqueue is shared by
      io-wq1 and io-wq2. (note: wqe is worker)
      
      io-wq1:worker2     | locks bit1
      io-wq2:worker1     | waits bit1
      io-wq1:worker3     | waits bit1
      
      io-wq1:worker2     | completes all wqe bit1 work items
      io-wq1:worker2     | drop bit1, exit
      
      io-wq2:worker1     | locks bit1
      io-wq1:worker3     | can not locks bit1, waits bit1 and exit
      io-wq1             | exit and free io-wq1
      io-wq2:worker1     | drops bit1
      io-wq1:worker3     | be waked up, even though wqe is freed
      
      After all iou-wrk belonging to io-wq1 have exited, remove wqe
      form hash waitqueue, it is guaranteed that there will be no more
      wqe belonging to io-wq1 in the hash waitqueue.
      
      Reported-by: default avatar <syzbot+6cb11ade52aa17095297@syzkaller.appspotmail.com>
      Signed-off-by: default avatarZqiang <qiang.zhang@windriver.com>
      Link: https://lore.kernel.org/r/20210526050826.30500-1-qiang.zhang@windriver.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      3743c172
    • Pavel Begunkov's avatar
      io_uring/io-wq: close io-wq full-stop gap · 17a91051
      Pavel Begunkov authored
      
      
      There is an old problem with io-wq cancellation where requests should be
      killed and are in io-wq but are not discoverable, e.g. in @next_hashed
      or @linked vars of io_worker_handle_work(). It adds some unreliability
      to individual request canellation, but also may potentially get
      __io_uring_cancel() stuck. For instance:
      
      1) An __io_uring_cancel()'s cancellation round have not found any
         request but there are some as desribed.
      2) __io_uring_cancel() goes to sleep
      3) Then workers wake up and try to execute those hidden requests
         that happen to be unbound.
      
      As we already cancel all requests of io-wq there, set IO_WQ_BIT_EXIT
      in advance, so preventing 3) from executing unbound requests. The
      workers will initially break looping because of getting a signal as they
      are threads of the dying/exec()'ing user task.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Link: https://lore.kernel.org/r/abfcf8c54cb9e8f7bfbad7e9a0cc5433cc70bdc2.1621781238.git.asml.silence@gmail.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      17a91051
  4. May 20, 2021
  5. May 17, 2021
  6. May 14, 2021
  7. May 09, 2021
    • Pavel Begunkov's avatar
      io_uring: fix link timeout refs · a298232e
      Pavel Begunkov authored
      WARNING: CPU: 0 PID: 10242 at lib/refcount.c:28 refcount_warn_saturate+0x15b/0x1a0 lib/refcount.c:28
      RIP: 0010:refcount_warn_saturate+0x15b/0x1a0 lib/refcount.c:28
      Call Trace:
       __refcount_sub_and_test include/linux/refcount.h:283 [inline]
       __refcount_dec_and_test include/linux/refcount.h:315 [inline]
       refcount_dec_and_test include/linux/refcount.h:333 [inline]
       io_put_req fs/io_uring.c:2140 [inline]
       io_queue_linked_timeout fs/io_uring.c:6300 [inline]
       __io_queue_sqe+0xbef/0xec0 fs/io_uring.c:6354
       io_submit_sqe fs/io_uring.c:6534 [inline]
       io_submit_sqes+0x2bbd/0x7c50 fs/io_uring.c:6660
       __do_sys_io_uring_enter fs/io_uring.c:9240 [inline]
       __se_sys_io_uring_enter+0x256/0x1d60 fs/io_uring.c:9182
      
      io_link_timeout_fn() should put only one reference of the linked timeout
      request, however in case of racing with the master request's completion
      first io_req_complete() puts one and then io_put_req_deferred() is
      called.
      
      Cc: stable@vger.kernel.org # 5.12+
      Fixes: 9ae1f8dd
      
       ("io_uring: fix inconsistent lock state")
      Reported-by: default avatar <syzbot+a2910119328ce8e7996f@syzkaller.appspotmail.com>
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Link: https://lore.kernel.org/r/ff51018ff29de5ffa76f09273ef48cb24c720368.1620417627.git.asml.silence@gmail.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      a298232e
  8. May 06, 2021
  9. Apr 30, 2021
    • Zqiang's avatar
      io_uring: Fix memory leak in io_sqe_buffers_register() · bb6659cc
      Zqiang authored
      
      
      unreferenced object 0xffff8881123bf0a0 (size 32):
      comm "syz-executor557", pid 8384, jiffies 4294946143 (age 12.360s)
      backtrace:
      [<ffffffff81469b71>] kmalloc_node include/linux/slab.h:579 [inline]
      [<ffffffff81469b71>] kvmalloc_node+0x61/0xf0 mm/util.c:587
      [<ffffffff815f0b3f>] kvmalloc include/linux/mm.h:795 [inline]
      [<ffffffff815f0b3f>] kvmalloc_array include/linux/mm.h:813 [inline]
      [<ffffffff815f0b3f>] kvcalloc include/linux/mm.h:818 [inline]
      [<ffffffff815f0b3f>] io_rsrc_data_alloc+0x4f/0xc0 fs/io_uring.c:7164
      [<ffffffff815f26d8>] io_sqe_buffers_register+0x98/0x3d0 fs/io_uring.c:8383
      [<ffffffff815f84a7>] __io_uring_register+0xf67/0x18c0 fs/io_uring.c:9986
      [<ffffffff81609222>] __do_sys_io_uring_register fs/io_uring.c:10091 [inline]
      [<ffffffff81609222>] __se_sys_io_uring_register fs/io_uring.c:10071 [inline]
      [<ffffffff81609222>] __x64_sys_io_uring_register+0x112/0x230 fs/io_uring.c:10071
      [<ffffffff842f616a>] do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
      [<ffffffff84400068>] entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Fix data->tags memory leak, through io_rsrc_data_free() to release
      data memory space.
      
      Reported-by: default avatar <syzbot+0f32d05d8b6cd8d7ea3e@syzkaller.appspotmail.com>
      Signed-off-by: default avatarZqiang <qiang.zhang@windriver.com>
      Link: https://lore.kernel.org/r/20210430082515.13886-1-qiang.zhang@windriver.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      bb6659cc
    • Colin Ian King's avatar
      io_uring: Fix premature return from loop and memory leak · cf3770e7
      Colin Ian King authored
      
      
      Currently the -EINVAL error return path is leaking memory allocated
      to data. Fix this by not returning immediately but instead setting
      the error return variable to -EINVAL and breaking out of the loop.
      
      Kudos to Pavel Begunkov for suggesting a correct fix.
      
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Reviewed-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Link: https://lore.kernel.org/r/20210429104602.62676-1-colin.king@canonical.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      cf3770e7
    • Pavel Begunkov's avatar
      io_uring: fix unchecked error in switch_start() · 47b228ce
      Pavel Begunkov authored
      
      
      io_rsrc_node_switch_start() can fail, don't forget to check returned
      error code.
      
      Reported-by: default avatar <syzbot+a4715dd4b7c866136f79@syzkaller.appspotmail.com>
      Fixes: eae071c9
      
       ("io_uring: prepare fixed rw for dynanic buffers")
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Link: https://lore.kernel.org/r/c4c06e2f3f0c8e43bd8d0a266c79055bcc6b6e60.1619693112.git.asml.silence@gmail.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      47b228ce
    • Pavel Begunkov's avatar
      io_uring: allow empty slots for reg buffers · 6224843d
      Pavel Begunkov authored
      
      
      Allow empty reg buffer slots any request using which should fail. This
      allows users to not register all buffers in advance, but do it lazily
      and/or on demand via updates. That is achieved by setting iov_base and
      iov_len to zero for registration and/or buffer updates. Empty buffer
      can't have a non-zero tag.
      
      Implementation details: to not add extra overhead to io_import_fixed(),
      create a dummy buffer crafted to fail any request using it, and set it
      to all empty buffer slots.
      
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Link: https://lore.kernel.org/r/7e95e4d700082baaf010c648c72ac764c9cc8826.1619611868.git.asml.silence@gmail.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6224843d
    • Pavel Begunkov's avatar
      io_uring: add more build check for uapi · b0d658ec
      Pavel Begunkov authored
      
      
      Add a couple of BUILD_BUG_ON() checking some rsrc uapi structs and SQE
      flags.
      
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Link: https://lore.kernel.org/r/ff960df4d5026b9fb5bfd80994b9d3667d3926da.1619536280.git.asml.silence@gmail.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b0d658ec
    • Pavel Begunkov's avatar
      io_uring: dont overlap internal and user req flags · dddca226
      Pavel Begunkov authored
      
      
      CQE flags take one byte that we store in req->flags together with other
      REQ_F_* internal flags. CQE flags are copied directly into req and then
      verified that requires some handling on failures, e.g. to make sure that
      that copy doesn't set some of the internal flags.
      
      Move all internal flags to take bits after the first byte, so we don't
      need extra handling and make it safer overall.
      
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Link: https://lore.kernel.org/r/b8b5b02d1ab9d786fcc7db4a3fe86db6b70b8987.1619536280.git.asml.silence@gmail.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      dddca226
    • Pavel Begunkov's avatar
      io_uring: fix drain with rsrc CQEs · 2840f710
      Pavel Begunkov authored
      Resource emitted CQEs are not bound to requests, so fix up counters used
      for DRAIN/defer logic.
      
      Fixes: b60c8dce
      
       ("io_uring: preparation for rsrc tagging")
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Link: https://lore.kernel.org/r/2b32f5f0a40d5928c3466d028f936e167f0654be.1619536280.git.asml.silence@gmail.com
      
      
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      2840f710
    • Linus Torvalds's avatar
      Merge tag 'x86-mm-2021-04-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 635de956
      Linus Torvalds authored
      Pull x86 tlb updates from Ingo Molnar:
       "The x86 MM changes in this cycle were:
      
         - Implement concurrent TLB flushes, which overlaps the local TLB
           flush with the remote TLB flush.
      
           In testing this improved sysbench performance measurably by a
           couple of percentage points, especially if TLB-heavy security
           mitigations are active.
      
         - Further micro-optimizations to improve the performance of TLB
           flushes"
      
      * tag 'x86-mm-2021-04-29' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        smp: Micro-optimize smp_call_function_many_cond()
        smp: Inline on_each_cpu_cond() and on_each_cpu()
        x86/mm/tlb: Remove unnecessary uses of the inline keyword
        cpumask: Mark functions as pure
        x86/mm/tlb: Do not make is_lazy dirty for no reason
        x86/mm/tlb: Privatize cpu_tlbstate
        x86/mm/tlb: Flush remote and local TLBs concurrently
        x86/mm/tlb: Open-code on_each_cpu_cond_mask() for tlb_is_not_lazy()
        x86/mm/tlb: Unify flush_tlb_func_local() and flush_tlb_func_remote()
        smp: Run functions concurrently in smp_call_function_many_cond()
      635de956
    • Linus Torvalds's avatar
      Merge tag 'microblaze-v5.13' of git://git.monstr.eu/linux-2.6-microblaze · d0cc7eca
      Linus Torvalds authored
      Pull Microblaze updates from Michal Simek:
       "No new features, just about cleaning up some code and moving to
        generic syscall solution used by other architectures:
      
         - Switch to generic syscall scripts
      
         - Some small fixes"
      
      * tag 'microblaze-v5.13' of git://git.monstr.eu/linux-2.6-microblaze:
        microblaze: add 'fallthrough' to memcpy/memset/memmove
        microblaze: Fix a typo
        microblaze: tag highmem_setup() with __meminit
        microblaze: syscalls: switch to generic syscallhdr.sh
        microblaze: syscalls: switch to generic syscalltbl.sh
      d0cc7eca
    • Linus Torvalds's avatar
      Merge tag 'mips_5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · 77d51337
      Linus Torvalds authored
      Pull MIPS updates from Thomas Bogendoerfer:
      
       - removed get_fs/set_fs
      
       - removed broken/unmaintained MIPS KVM trap and emulate support
      
       - added support for Loongson-2K1000
      
       - fixes and cleanups
      
      * tag 'mips_5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: (107 commits)
        MIPS: BCM63XX: Use BUG_ON instead of condition followed by BUG.
        MIPS: select ARCH_KEEP_MEMBLOCK unconditionally
        mips: Do not include hi and lo in clobber list for R6
        MIPS:DTS:Correct the license for Loongson-2K
        MIPS:DTS:Fix label name and interrupt number of ohci for Loongson-2K
        MIPS: Avoid handcoded DIVU in `__div64_32' altogether
        lib/math/test_div64: Correct the spelling of "dividend"
        lib/math/test_div64: Fix error message formatting
        mips/bootinfo:correct some comments of fw_arg
        MIPS: Avoid DIVU in `__div64_32' is result would be zero
        MIPS: Reinstate platform `__div64_32' handler
        div64: Correct inline documentation for `do_div'
        lib/math: Add a `do_div' test module
        MIPS: Makefile: Replace -pg with CC_FLAGS_FTRACE
        MIPS: pci-legacy: revert "use generic pci_enable_resources"
        MIPS: Loongson64: Add kexec/kdump support
        MIPS: pci-legacy: use generic pci_enable_resources
        MIPS: pci-legacy: remove busn_resource field
        MIPS: pci-legacy: remove redundant info messages
        MIPS: pci-legacy: stop using of_pci_range_to_resource
        ...
      77d51337
    • Linus Torvalds's avatar
      Merge tag 'fsnotify_for_v5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 3644286f
      Linus Torvalds authored
      Pull fsnotify updates from Jan Kara:
      
       - support for limited fanotify functionality for unpriviledged users
      
       - faster merging of fanotify events
      
       - a few smaller fsnotify improvements
      
      * tag 'fsnotify_for_v5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        shmem: allow reporting fanotify events with file handles on tmpfs
        fs: introduce a wrapper uuid_to_fsid()
        fanotify_user: use upper_32_bits() to verify mask
        fanotify: support limited functionality for unprivileged users
        fanotify: configurable limits via sysfs
        fanotify: limit number of event merge attempts
        fsnotify: use hash table for faster events merge
        fanotify: mix event info and pid into merge key hash
        fanotify: reduce event objectid to 29-bit hash
        fsnotify: allow fsnotify_{peek,remove}_first_event with empty queue
      3644286f
    • Linus Torvalds's avatar
      Merge tag 'for_v5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 767fcbc8
      Linus Torvalds authored
      Pull quota, ext2, reiserfs updates from Jan Kara:
      
       - support for path (instead of device) based quotactl syscall
         (quotactl_path(2))
      
       - ext2 conversion to kmap_local()
      
       - other minor cleanups & fixes
      
      * tag 'for_v5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        fs/reiserfs/journal.c: delete useless variables
        fs/ext2: Replace kmap() with kmap_local_page()
        ext2: Match up ext2_put_page() with ext2_dotdot() and ext2_find_entry()
        fs/ext2/: fix misspellings using codespell tool
        quota: report warning limits for realtime space quotas
        quota: wire up quotactl_path
        quota: Add mountpath based quota support
      767fcbc8
    • Linus Torvalds's avatar
      Merge tag 'xfs-5.13-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · d2b6f8a1
      Linus Torvalds authored
      Pull xfs updates from Darrick Wong:
       "The notable user-visible addition this cycle is ability to remove
        space from the last AG in a filesystem. This is the first of many
        changes needed for full-fledged support for shrinking a filesystem.
        Still needed are (a) the ability to reorganize files and metadata away
        from the end of the fs; (b) the ability to remove entire allocation
        groups; (c) shrink support for realtime volumes; and (d) thorough
        testing of (a-c).
      
        There are a number of performance improvements in this code drop: Dave
        streamlined various parts of the buffer logging code and reduced the
        cost of various debugging checks, and added the ability to pre-create
        the xattr structures while creating files. Brian eliminated
        transaction reservations that were being held across writeback (thus
        reducing livelock potential.
      
        Other random pieces: Pavel fixed the repetitve warnings about
        deprecated mount options, I fixed online fsck to behave itself when a
        readonly remount comes in during scrub, and refactored various other
        parts of that code, Christoph contributed a lot of refactoring this
        cycle. The xfs_icdinode structure has been absorbed into the (incore)
        xfs_inode structure, and the format and flags handling around
        xfs_inode_fork structures has been simplified. Chandan provided a
        number of fixes for extent count overflow related problems that have
        been shaken out by debugging knobs added during 5.12.
      
        Summary:
      
         - Various minor fixes in online scrub.
      
         - Prevent metadata files from being automatically inactivated.
      
         - Validate btree heights by the computed per-btree limits.
      
         - Don't warn about remounting with deprecated mount options.
      
         - Initialize attr forks at create time if we suspect we're going to
           need to store them.
      
         - Reduce memory reallocation workouts in the logging code.
      
         - Fix some theoretical math calculation errors in logged buffers that
           span multiple discontig memory ranges but contiguous ondisk
           regions.
      
         - Speedups in dirty buffer bitmap handling.
      
         - Make type verifier functions more inline-happy to reduce overhead.
      
         - Reduce debug overhead in directory checking code.
      
         - Many many typo fixes.
      
         - Begin to handle the permanent loss of the very end of a filesystem.
      
         - Fold struct xfs_icdinode into xfs_inode.
      
         - Deprecate the long defunct BMV_IF_NO_DMAPI_READ from the bmapx
           ioctl.
      
         - Remove a broken directory block format check from online scrub.
      
         - Fix a bug where we could produce an unnecessarily tall data fork
           btree when creating an attr fork.
      
         - Fix scrub and readonly remounts racing.
      
         - Fix a writeback ioend log deadlock problem by dropping the behavior
           where we could preallocate a setfilesize transaction.
      
         - Fix some bugs in the new extent count checking code.
      
         - Fix some bugs in the attr fork preallocation code.
      
         - Refactor if_flags out of the incore inode fork data structure"
      
      * tag 'xfs-5.13-merge-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (77 commits)
        xfs: remove xfs_quiesce_attr declaration
        xfs: remove XFS_IFEXTENTS
        xfs: remove XFS_IFINLINE
        xfs: remove XFS_IFBROOT
        xfs: only look at the fork format in xfs_idestroy_fork
        xfs: simplify xfs_attr_remove_args
        xfs: rename and simplify xfs_bmap_one_block
        xfs: move the XFS_IFEXTENTS check into xfs_iread_extents
        xfs: drop unnecessary setfilesize helper
        xfs: drop unused ioend private merge and setfilesize code
        xfs: open code ioend needs workqueue helper
        xfs: drop submit side trans alloc for append ioends
        xfs: fix return of uninitialized value in variable error
        xfs: get rid of the ip parameter to xchk_setup_*
        xfs: fix scrub and remount-ro protection when running scrub
        xfs: move the check for post-EOF mappings into xfs_can_free_eofblocks
        xfs: move the xfs_can_free_eofblocks call under the IOLOCK
        xfs: precalculate default inode attribute offset
        xfs: default attr fork size does not handle device inodes
        xfs: inode fork allocation depends on XFS_IFEXTENT flag
        ...
      d2b6f8a1
    • Linus Torvalds's avatar
      Merge tag 'gfs2-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · f2c80837
      Linus Torvalds authored
      Pull gfs2 updates from Andreas Gruenbacher:
      
       - Fix some compiler and kernel-doc warnings
      
       - Various minor cleanups and optimizations
      
       - Add a new sysfs gfs2 status file with some filesystem wide
         information
      
      * tag 'gfs2-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: Fix fall-through warnings for Clang
        gfs2: Fix a number of kernel-doc warnings
        gfs2: Make gfs2_setattr_simple static
        gfs2: Add new sysfs file for gfs2 status
        gfs2: Silence possible null pointer dereference warning
        gfs2: Turn gfs2_meta_indirect_buffer into gfs2_meta_buffer
        gfs2: Replace gfs2_lblk_to_dblk with gfs2_get_extent
        gfs2: Turn gfs2_extent_map into gfs2_{get,alloc}_extent
        gfs2: Add new gfs2_iomap_get helper
        gfs2: Remove unused variable sb_format
        gfs2: Fix dir.c function parameter descriptions
        gfs2: Eliminate gh parameter from go_xmote_bh func
        gfs2: don't create empty buffers for NO_CREATE
      f2c80837
    • Linus Torvalds's avatar
      Merge tag 'exfat-for-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat · 8ae8932c
      Linus Torvalds authored
      Pull exfat updates from Namjae Jeon:
      
       - Improve write performance with dirsync mount option
      
       - Improve lookup performance
      
       - Add support for FITRIM ioctl
      
       - Fix a bug with discard option
      
      * tag 'exfat-for-5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/linkinjeon/exfat:
        exfat: speed up iterate/lookup by fixing start point of traversing cluster chain
        exfat: improve write performance when dirsync enabled
        exfat: add support ioctl and FITRIM function
        exfat: introduce bitmap_lock for cluster bitmap access
        exfat: fix erroneous discard when clear cluster bit
      8ae8932c
  10. Apr 29, 2021
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · d72cd4ad
      Linus Torvalds authored
      Pull SCSI updates from James Bottomley:
       "This consists of the usual driver updates (ufs, target, tcmu,
        smartpqi, lpfc, zfcp, qla2xxx, mpt3sas, pm80xx).
      
        The major core change is using a sbitmap instead of an atomic for
        queue tracking"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (412 commits)
        scsi: target: tcm_fc: Fix a kernel-doc header
        scsi: target: Shorten ALUA error messages
        scsi: target: Fix two format specifiers
        scsi: target: Compare explicitly with SAM_STAT_GOOD
        scsi: sd: Introduce a new local variable in sd_check_events()
        scsi: dc395x: Open-code status_byte(u8) calls
        scsi: 53c700: Open-code status_byte(u8) calls
        scsi: smartpqi: Remove unused functions
        scsi: qla4xxx: Remove an unused function
        scsi: myrs: Remove unused functions
        scsi: myrb: Remove unused functions
        scsi: mpt3sas: Fix two kernel-doc headers
        scsi: fcoe: Suppress a compiler warning
        scsi: l...
      d72cd4ad
    • Linus Torvalds's avatar
      Merge tag 'vfio-v5.13-rc1' of git://github.com/awilliam/linux-vfio · 238da4d0
      Linus Torvalds authored
      Pull VFIO updates from Alex Williamson:
      
       - Embed struct vfio_device into vfio driver structures (Jason
         Gunthorpe)
      
       - Make vfio_mdev type safe (Jason Gunthorpe)
      
       - Remove vfio-pci NVLink2 extensions for POWER9 (Christoph Hellwig)
      
       - Update vfio-pci IGD extensions for OpRegion 2.1+ (Fred Gao)
      
       - Various spelling/blank line fixes (Zhen Lei, Zhou Wang, Bhaskar
         Chowdhury)
      
       - Simplify unpin_pages error handling (Shenming Lu)
      
       - Fix i915 mdev Kconfig dependency (Arnd Bergmann)
      
       - Remove unused structure member (Keqian Zhu)
      
      * tag 'vfio-v5.13-rc1' of git://github.com/awilliam/linux-vfio: (43 commits)
        vfio/gvt: fix DRM_I915_GVT dependency on VFIO_MDEV
        vfio/iommu_type1: Remove unused pinned_page_dirty_scope in vfio_iommu
        vfio/mdev: Correct the function signatures for the mdev_type_attributes
        vfio/mdev: Remove kobj from mdev_parent_ops->create()
        vfio/gvt: Use mdev_get_type_group_id()
        vfio/gvt: Make DRM_I915_GVT depend on VFIO_MDEV
        vfio/mbochs: Use mdev_get_type_group_id()
        vfio/mdpy: Use mdev_get_type_group_id()
        vfio/mtty: Use mdev_get_type_group_id()
        vfio/mdev: Add mdev/mtype_get_type_group_id()
        vfio/mdev: Remove duplicate storage of parent in mdev_device
        vfio/mdev: Add missing error handling to dev_set_name()
        vfio/mdev: Reorganize mdev_device_create()
        vfio/mdev: Add missing reference counting to mdev_type
        vfio/mdev: Expose mdev_get/put_parent to mdev_private.h
        vfio/mdev: Use struct mdev_type in struct mdev_device
        vfio/mdev: Simplify driver registration
        vfio/mdev: Add missing typesafety around mdev_device
        vfio/mdev: Do not allow a mdev_type to have a NULL parent pointer
        vfio/mdev: Fix missing static's on MDEV_TYPE_ATTR's
        ...
      238da4d0
    • Linus Torvalds's avatar
      Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · 35655ceb
      Linus Torvalds authored
      Pull clk updates from Stephen Boyd:
       "Here's a collection of largely clk driver updates. The usual suspects
        are here: i.MX, Qualcomm, Renesas, Allwinner, Samsung, and Rockchip,
        but it feels pretty light on commits.
      
        There's only one real commit to the framework core and that's to
        consolidate code. Otherwise the diffstat is dominated by many Qualcomm
        clk driver patches that modernize the driver for the proper way of
        speciying clk parents. That's shifting data around, which could subtly
        break things so I'll be on the lookout for fixes.
      
        New Drivers:
         - Proper clk driver for Mediatek MT7621 SoCs
         - Support for the clock controller on the new Rockchip rk3568
      
        Updates:
         - Simplify Zynq Kconfig dependencies
         - Use clk_hw pointers in socfpga driver
         - Cleanup parent data in qcom clk drivers
         - Some cleanups for rk3399 modularization
         - Fix reparenting of i.MX UART clocks by initializing only the o...
      35655ceb
    • Linus Torvalds's avatar
      Merge tag 'mailbox-v5.13' of git://git.linaro.org/landing-teams/working/fujitsu/integration · d8201efe
      Linus Torvalds authored
      Pull mailbox updates from Jassi Brar:
       "qcom:
         - enable support for SM8350 and SC7280
      
        sprd:
         - refcount channel usage
         - specify interrupt names in dt
         - support sc9863a
      
        arm:
         - drop redundant print
      
        ti:
         - convert dt-bindings to json schema
      
        and misc spelling fixes"
      
      * tag 'mailbox-v5.13' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
        dt-bindings: mailbox: qcom-ipcc: Add compatible for SC7280
        dt-bindings: mailbox: ti,secure-proxy: Convert to json schema
        mailbox: arm_mhu_db: Remove redundant dev_err call in mhu_db_probe()
        mailbox: sprd: Add supplementary inbox support
        dt-bindings: mailbox: Add interrupt-names to SPRD mailbox
        mailbox: sprd: Introduce refcnt when clients requests/free channels
        MAINTAINERS: Add DT bindings directory to mailbox
        mailbox: fix various typos in comments
        mailbox: pcc: fix platform_no_drv_owner.cocci warnings
        dt-bindings: mailbox:...
      d8201efe
    • Linus Torvalds's avatar
      Merge tag 'backlight-next-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight · c969f245
      Linus Torvalds authored
      Pull backlight updates from Lee Jones:
       "New Device Support:
         - Add support for PMI8994 to Qualcom WLED
         - Add support for KTD259 to Kinetic KTD253
      
        Fix-ups:
         - Device Tree related fix-ups; kinetic,ktd253
         - Use proper sequence during sync_toggle; qcom-wled
         - Fix Wmisleading-indentation warnings; jornada720_bl
      
        Bug Fixes:
         - Fix sync toggle on WLED4; qcom-wled
         - Fix FSC update on WLED5; qcom-wled"
      
      * tag 'backlight-next-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
        backlight: journada720: Fix Wmisleading-indentation warning
        backlight: qcom-wled: Correct the sync_toggle sequence
        backlight: qcom-wled: Fix FSC update issue for WLED5
        dt-bindings: backlight: Add Kinetic KTD259 bindings
        backlight: ktd253: Support KTD259
        backlight: qcom-wled: Use sink_addr for sync toggle
        dt-bindings: backlight: qcom-wled: Add PMI8994 compatible
      c969f245
    • Linus Torvalds's avatar
      Merge tag 'mfd-next-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd · 71a5cc28
      Linus Torvalds authored
      Pull MFD updates from Lee Jones:
       "Core Framework:
         - Add support for Software Nodes to MFD Core
         - Remove support for Device Properties from MFD Core
         - Use standard APIs in MFD Core
      
        New Drivers:
         - Add support for ROHM BD9576MUF and BD9573MUF PMICs
         - Add support for Netronix Embedded Controller, PWM and RTC
         - Add support for Actions Semi ATC260x PMICs and OnKey
      
        New Device Support:
         - Add support for DG1 PCIe Graphics Card to Intel PMT
         - Add support for ROHM BD71815 PMIC to ROHM BD71828
         - Add support for Tolino Shine 2 HD to Netronix Embedded Controller
         - Add support for AX10 BMC Secure Updates to Intel M10 BMC
      
        Removed Device Support:
         - Remove Arizona Extcon support from MFD
         - Remove ST-E AB8500 Power Supply code from MFD
         - Remove AB3100 altogether
      
        New Functionality:
         - Add support for SMBus and I2C modes to Dialog DA9063
         - Switch to using Software Nodes in Intel (various)...
      71a5cc28
    • Linus Torvalds's avatar
      Merge tag 'mmc-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · be18cd1f
      Linus Torvalds authored
      Pull MMC and MEMSTICK updates from Ulf Hansson:
       "MMC core:
         - Fix hanging on I/O during system suspend for removable cards
         - Set read only for SD cards with permanent write protect bit
         - Power cycle the SD/SDIO card if CMD11 fails for UHS voltage
         - Issue a cache flush for eMMC only when it's enabled
         - Adopt to updated cache ctrl settings for eMMC from MMC ioctls
         - Use use device property API when parsing voltages
         - Don't retry eMMC sanitize cmds
         - Use the timeout from the MMC ioctl for eMMC santize cmds
      
        MMC host:
         - mmc_spi: Make of_mmc_spi.c resource provider agnostic
         - mmc_spi: Use polling for card detect even without voltage-ranges
         - sdhci: Check for reset prior to DMA address unmap
         - sdhci-acpi: Add support for the AMDI0041 eMMC controller variant
         - sdhci-esdhc-imx: Depending on OF Kconfig and cleanup code
         - sdhci-pci: Add PCI IDs for Intel LKF
         - sdhci-pci: Fix initialization ...
      be18cd1f
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.13-1' of git://github.com/cminyard/linux-ipmi · 6fa09d31
      Linus Torvalds authored
      Pull IPMI updates from Corey Minyard:
       "A bunch of little cleanups
      
        Nothing major, no functional changes"
      
      * tag 'for-linus-5.13-1' of git://github.com/cminyard/linux-ipmi:
        ipmi_si: Join string literals back
        ipmi_si: Drop redundant check before calling put_device()
        ipmi_si: Use strstrip() to remove surrounding spaces
        ipmi_si: Get rid of ->addr_source_cleanup()
        ipmi_si: Reuse si_to_str[] array in ipmi_hardcode_init_one()
        ipmi_si: Introduce ipmi_panic_event_str[] array
        ipmi_si: Use proper ACPI macros to check error code for failures
        ipmi_si: Utilize temporary variable to hold device pointer
        ipmi_si: Remove bogus err_free label
        ipmi_si: Switch to use platform_get_mem_or_io()
        ipmi: Handle device properties with software node API
        ipmi:ssif: make ssif_i2c_send() void
        ipmi: Refine retry conditions for getting device id
      6fa09d31
    • Linus Torvalds's avatar
      Merge tag 'devicetree-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 0080665f
      Linus Torvalds authored
      Pull devicetree updates from Rob Herring:
      
       - Refactor powerpc and arm64 kexec DT handling to common code. This
         enables IMA on arm64.
      
       - Add kbuild support for applying DT overlays at build time. The first
         user are the DT unittests.
      
       - Fix kerneldoc formatting and W=1 warnings in drivers/of/
      
       - Fix handling 64-bit flag on PCI resources
      
       - Bump dtschema version required to v2021.2.1
      
       - Enable undocumented compatible checks for dtbs_check. This allows
         tracking of missing binding schemas.
      
       - DT docs improvements. Regroup the DT docs and add the example schema
         and DT kernel ABI docs to the doc build.
      
       - Convert Broadcom Bluetooth and video-mux bindings to schema
      
       - Add QCom sm8250 Venus video codec binding schema
      
       - Add vendor prefixes for AESOP, YIC System Co., Ltd, and Siliconfile
         Technologies Inc.
      
       - Cleanup of DT schema type references on common properties and
         standard unit properties
      
      * tag 'devicetree-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (64 commits)
        powerpc: If kexec_build_elf_info() fails return immediately from elf64_load()
        powerpc: Free fdt on error in elf64_load()
        of: overlay: Fix kerneldoc warning in of_overlay_remove()
        of: linux/of.h: fix kernel-doc warnings
        of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses
        dt-bindings: bcm4329-fmac: add optional brcm,ccode-map
        docs: dt: update writing-schema.rst references
        dt-bindings: media: venus: Add sm8250 dt schema
        of: base: Fix spelling issue with function param 'prop'
        docs: dt: Add DT API documentation
        of: Add missing 'Return' section in kerneldoc comments
        of: Fix kerneldoc output formatting
        docs: dt: Group DT docs into relevant sub-sections
        docs: dt: Make 'Devicetree' wording more consistent
        docs: dt: writing-schema: Include the example schema in the doc build
        docs: dt: writing-schema: Remove spurious indentation
        dt-bindings: Fix reference in submitting-patches.rst to the DT ABI doc
        dt-bindings: ddr: Add optional manufacturer and revision ID to LPDDR3
        dt-bindings: media: video-interfaces: Drop the example
        devicetree: bindings: clock: Minor typo fix in the file armada3700-tbg-clock.txt
        ...
      0080665f
    • Linus Torvalds's avatar
      Merge tag 'for-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply · 5a69e9bc
      Linus Torvalds authored
      Pull power supply and reset updates from Sebastian Reichel:
       "battery/charger driver changes:
         - core:
            - provide function stubs if CONFIG_POWER_SUPPLY=n
            - reduce loglevel for probe defer info
         - surface:
            - new battery and charger drivers for Surface
         - bq27xxx:
            - add bq78z100 support
            - fix current_now/power_avg for newer chips
         - cw2015:
            - add CHARGE_NOW support
         - ab8500:
            - drop pdata support
         - convert most DT bindings to YAML
         - lots of minor fixes and cleanups
      
        reset drivers:
         - ltc2952-poweroff:
            - make trigger delay configurable from DT
         - minor fixes and cleanups"
      
      * tag 'for-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (97 commits)
        power: supply: cpcap-battery: fix invalid usage of list cursor
        power: supply: bq256xx: add kerneldoc for structure members
        power: supply: act8945a: correct kerneldoc
        po...
      5a69e9bc
    • Linus Torvalds's avatar
      Merge tag 'hsi-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi · a8b5e037
      Linus Torvalds authored
      Pull HSI update from Sebastian Reichel:
      
       - memory leak fix in hsi_add_client_from_dt() error path
      
      * tag 'hsi-for-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi:
        HSI: core: fix resource leaks in hsi_add_client_from_dt()
      a8b5e037
    • Linus Torvalds's avatar
      Merge tag 'for-5.13/io_uring-2021-04-27' of git://git.kernel.dk/linux-block · 625434da
      Linus Torvalds authored
      Pull io_uring updates from Jens Axboe:
      
       - Support for multi-shot mode for POLL requests
      
       - More efficient reference counting. This is shamelessly stolen from
         the mm side. Even though referencing is mostly single/dual user, the
         128 count was retained to keep the code the same. Maybe this
         should/could be made generic at some point.
      
       - Removal of the need to have a manager thread for each ring. The
         manager threads only job was checking and creating new io-threads as
         needed, instead we handle this from the queue path.
      
       - Allow SQPOLL without CAP_SYS_ADMIN or CAP_SYS_NICE. Since 5.12, this
         thread is "just" a regular application thread, so no need to restrict
         use of it anymore.
      
       - Cleanup of how internal async poll data lifetime is managed.
      
       - Fix for syzbot reported crash on SQPOLL cancelation.
      
       - Make buffer registration more like file registrations, which includes
         flexibility in avoiding full set unregistration and re-registration.
      
       - Fix for io-wq affinity setting.
      
       - Be a bit more defensive in task->pf_io_worker setup.
      
       - Various SQPOLL fixes.
      
       - Cleanup of SQPOLL creds handling.
      
       - Improvements to in-flight request tracking.
      
       - File registration cleanups.
      
       - Tons of cleanups and little fixes
      
      * tag 'for-5.13/io_uring-2021-04-27' of git://git.kernel.dk/linux-block: (156 commits)
        io_uring: maintain drain logic for multishot poll requests
        io_uring: Check current->io_uring in io_uring_cancel_sqpoll
        io_uring: fix NULL reg-buffer
        io_uring: simplify SQPOLL cancellations
        io_uring: fix work_exit sqpoll cancellations
        io_uring: Fix uninitialized variable up.resv
        io_uring: fix invalid error check after malloc
        io_uring: io_sq_thread() no longer needs to reset current->pf_io_worker
        kernel: always initialize task->pf_io_worker to NULL
        io_uring: update sq_thread_idle after ctx deleted
        io_uring: add full-fledged dynamic buffers support
        io_uring: implement fixed buffers registration similar to fixed files
        io_uring: prepare fixed rw for dynanic buffers
        io_uring: keep table of pointers to ubufs
        io_uring: add generic rsrc update with tags
        io_uring: add IORING_REGISTER_RSRC
        io_uring: enumerate dynamic resources
        io_uring: add generic path for rsrc update
        io_uring: preparation for rsrc tagging
        io_uring: decouple CQE filling from requests
        ...
      625434da