1. 07 Jan, 2021 2 commits
    • Jens Axboe's avatar
      Merge tag 'nvme-5.11-2021-01-07' of git://git.infradead.org/nvme into block-5.11 · 04b1ecb6
      Jens Axboe authored
      Pull NVMe updates from Christoph:
      
      "nvme updates for 5.11:
      
       - fix a race in the nvme-tcp send code (Sagi Grimberg)
       - fix a list corruption in an nvme-rdma error path (Israel Rukshin)
       - avoid a possible double fetch in nvme-pci (Lalithambika Krishnakumar)
       - add the susystem NQN quirk for a Samsung driver (Gopal Tiwari)
       - fix two compiler warnings in nvme-fcloop (James Smart)
       - don't call sleeping functions from irq context in nvme-fc (James Smart)
       - remove an unused argument (Max Gurtovoy)
       - remove unused exports (Minwoo Im)"
      
      * tag 'nvme-5.11-2021-01-07' of git://git.infradead.org/nvme:
        nvme: remove the unused status argument from nvme_trace_bio_complete
        nvmet-rdma: Fix list_del corruption on queue establishment failure
        nvme: unexport functions with no external caller
        nvme: avoid possible double fetch in handling CQE
        nvme-tcp: Fix possible race of io_work and direct send
        nvme-pci: mark Samsung PM1725a as IGNORE_DEV_SUBNQN
        nvme-fcloop: Fix sscanf type and list_first_entry_or_null warnings
        nvme-fc: avoid calling _nvme_fc_abort_outstanding_ios from interrupt context
      04b1ecb6
    • Satya Tangirala's avatar
      fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb · 04a6a536
      Satya Tangirala authored
      freeze/thaw_bdev() currently use bdev->bd_fsfreeze_count to infer
      whether or not bdev->bd_fsfreeze_sb is valid (it's valid iff
      bd_fsfreeze_count is non-zero). thaw_bdev() doesn't nullify
      bd_fsfreeze_sb.
      
      But this means a freeze_bdev() call followed by a thaw_bdev() call can
      leave bd_fsfreeze_sb with a non-null value, while bd_fsfreeze_count is
      zero. If freeze_bdev() is called again, and this time
      get_active_super() returns NULL (e.g. because the FS is unmounted),
      we'll end up with bd_fsfreeze_count > 0, but bd_fsfreeze_sb is
      *untouched* - it stays the same (now garbage) value. A subsequent
      thaw_bdev() will decide that the bd_fsfreeze_sb value is legitimate
      (since bd_fsfreeze_count > 0), and attempt to use it.
      
      Fix this by always setting bd_fsfreeze_sb to NULL when
      bd_fsfreeze_count is successfully decremented to 0 in thaw_sb().
      Alternatively, we could set bd_fsfreeze_sb to whatever
      get_active_super() returns in freeze_bdev() whenever bd_fsfreeze_count
      is successfully incremented to 1 from 0 (which can be achieved cleanly
      by moving the line currently setting bd_fsfreeze_sb to immediately
      after the "sync:" label, but it might be a little too subtle/easily
      overlooked in future).
      
      This fixes the currently panicking xfstests generic/085.
      
      Fixes: 040f04bd ("fs: simplify freeze_bdev/thaw_bdev")
      Signed-off-by: default avatarSatya Tangirala <satyat@google.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      04a6a536
  2. 06 Jan, 2021 8 commits
  3. 05 Jan, 2021 3 commits
    • Ming Lei's avatar
      block: fix use-after-free in disk_part_iter_next · aebf5db9
      Ming Lei authored
      Make sure that bdgrab() is done on the 'block_device' instance before
      referring to it for avoiding use-after-free.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: syzbot+825f0f9657d4e528046e@syzkaller.appspotmail.com
      Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      aebf5db9
    • Jan Kara's avatar
      bfq: Fix computation of shallow depth · 6d4d2735
      Jan Kara authored
      BFQ computes number of tags it allows to be allocated for each request type
      based on tag bitmap. However it uses 1 << bitmap.shift as number of
      available tags which is wrong. 'shift' is just an internal bitmap value
      containing logarithm of how many bits bitmap uses in each bitmap word.
      Thus number of tags allowed for some request types can be far to low.
      Use proper bitmap.depth which has the number of tags instead.
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6d4d2735
    • Tejun Heo's avatar
      blk-iocost: fix NULL iocg deref from racing against initialization · d16baa3f
      Tejun Heo authored
      When initializing iocost for a queue, its rqos should be registered before
      the blkcg policy is activated to allow policy data initiailization to lookup
      the associated ioc. This unfortunately means that the rqos methods can be
      called on bios before iocgs are attached to all existing blkgs.
      
      While the race is theoretically possible on ioc_rqos_throttle(), it mostly
      happened in ioc_rqos_merge() due to the difference in how they lookup ioc.
      The former determines it from the passed in @rqos and then bails before
      dereferencing iocg if the looked up ioc is disabled, which most likely is
      the case if initialization is still in progress. The latter looked up ioc by
      dereferencing the possibly NULL iocg making it a lot more prone to actually
      triggering the bug.
      
      * Make ioc_rqos_merge() use the same method as ioc_rqos_throttle() to look
        up ioc for consistency.
      
      * Make ioc_rqos_throttle() and ioc_rqos_merge() test for NULL iocg before
        dereferencing it.
      
      * Explain the danger of NULL iocgs in blk_iocost_init().
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Reported-by: default avatarJonathan Lemon <bsd@fb.com>
      Cc: stable@vger.kernel.org # v5.4+
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      d16baa3f
  4. 03 Jan, 2021 2 commits
  5. 29 Dec, 2020 2 commits
  6. 27 Dec, 2020 8 commits
  7. 26 Dec, 2020 5 commits
  8. 25 Dec, 2020 5 commits
    • Linus Torvalds's avatar
      drm/amd/display: avoid uninitialized variable warning · 61d79136
      Linus Torvalds authored
      clang (quite rightly) complains fairly loudly about the newly added
      mpc1_get_mpc_out_mux() function returning an uninitialized value if the
      'opp_id' checks don't pass.
      
      This may not happen in practice, but the code really shouldn't return
      garbage if the sanity checks don't pass.
      
      So just initialize 'val' to zero to avoid the issue.
      
      Fixes: 110b055b ("drm/amd/display: add getter routine to retrieve mpcc mux")
      Cc: Josip Pavic <Josip.Pavic@amd.com>
      Cc: Bindu Ramamurthy <bindu.r@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      61d79136
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-2020-12-24' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux · 5814bc2d
      Linus Torvalds authored
      Pull more perf tools updates from Arnaldo Carvalho de Melo:
      
       - Refactor 'perf stat' per CPU/socket/die/thread aggregation fixing use
         cases in ARM machines.
      
       - Fix memory leak when synthesizing SDT probes in 'perf probe'.
      
       - Update kernel header copies related to KVM, epol_pwait. msr-index and
         powerpc and s390 syscall tables.
      
      * tag 'perf-tools-2020-12-24' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (24 commits)
        perf probe: Fix memory leak when synthesizing SDT probes
        perf stat aggregation: Add separate thread member
        perf stat aggregation: Add separate core member
        perf stat aggregation: Add separate die member
        perf stat aggregation: Add separate socket member
        perf stat aggregation: Add separate node member
        perf stat aggregation: Start using cpu_aggr_id in map
        perf cpumap: Drop in cpu_aggr_map struct
        perf cpumap: Add new map type for aggregation
        perf stat: Replace aggregation ID with a struct
        perf cpumap: Add new struct for cpu aggregation
        perf cpumap: Use existing allocator to avoid using malloc
        perf tests: Improve topology test to check all aggregation types
        perf tools: Update s390's syscall.tbl copy from the kernel sources
        perf tools: Update powerpc's syscall.tbl copy from the kernel sources
        perf s390: Move syscall.tbl check into check-headers.sh
        perf powerpc: Move syscall.tbl check to check-headers.sh
        tools headers UAPI: Synch KVM's svm.h header with the kernel
        tools kvm headers: Update KVM headers from the kernel sources
        tools headers UAPI: Sync KVM's vmx.h header with the kernel sources
        ...
      5814bc2d
    • Linus Torvalds's avatar
      Merge branch 'for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux · 42dc45e8
      Linus Torvalds authored
      Pull coccinelle updates from Julia Lawall.
      
      * 'for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux:
        scripts: coccicheck: Correct usage of make coccicheck
        coccinelle: update expiring email addresses
        coccinnelle: Remove ptr_ret script
        kbuild: do not use scripts/ld-version.sh for checking spatch version
        remove boolinit.cocci
      42dc45e8
    • Michael Ellerman's avatar
      genirq: Fix export of irq_to_desc() for powerpc KVM · 11cc92eb
      Michael Ellerman authored
      Commit 64a1b95b ("genirq: Restrict export of irq_to_desc()") removed
      the export of irq_to_desc() unless powerpc KVM is being built, because
      there is still a use of irq_to_desc() in modular code there.
      
      However it used:
      
        #ifdef CONFIG_KVM_BOOK3S_64_HV
      
      Which doesn't work when that symbol is =m, leading to a build failure:
      
        ERROR: modpost: "irq_to_desc" [arch/powerpc/kvm/kvm-hv.ko] undefined!
      
      Fix it by checking for the definedness of the correct symbol which is
      CONFIG_KVM_BOOK3S_64_HV_MODULE.
      
      Fixes: 64a1b95b ("genirq: Restrict export of irq_to_desc()")
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      11cc92eb
    • Linus Torvalds's avatar
      Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 7bb5226c
      Linus Torvalds authored
      Pull misc vfs updates from Al Viro:
       "Assorted patches from previous cycle(s)..."
      
      * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fix hostfs_open() use of ->f_path.dentry
        Make sure that make_create_in_sticky() never sees uninitialized value of dir_mode
        fs: Kill DCACHE_DONTCACHE dentry even if DCACHE_REFERENCED is set
        fs: Handle I_DONTCACHE in iput_final() instead of generic_drop_inode()
        fs/namespace.c: WARN if mnt_count has become negative
      7bb5226c
  9. 24 Dec, 2020 5 commits
    • Linus Torvalds's avatar
      Merge tag 'docs-5.11-2' of git://git.lwn.net/linux · 71c5f031
      Linus Torvalds authored
      Pull documentation fixes from Jonathan Corbet:
       "A small set of late-arriving, small documentation fixes"
      
      * tag 'docs-5.11-2' of git://git.lwn.net/linux:
        docs: admin-guide: Fix default value of max_map_count in sysctl/vm.rst
        Documentation/submitting-patches: Document the SoB chain
        Documentation: process: Correct numbering
        docs: submitting-patches: Trivial - fix grammatical error
      71c5f031
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · 555a6e8c
      Linus Torvalds authored
      Pull ext4 updates from Ted Ts'o:
       "Various bug fixes and cleanups for ext4; no new features this cycle"
      
      * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (29 commits)
        ext4: remove unnecessary wbc parameter from ext4_bio_write_page
        ext4: avoid s_mb_prefetch to be zero in individual scenarios
        ext4: defer saving error info from atomic context
        ext4: simplify ext4 error translation
        ext4: move functions in super.c
        ext4: make ext4_abort() use __ext4_error()
        ext4: standardize error message in ext4_protect_reserved_inode()
        ext4: remove redundant sb checksum recomputation
        ext4: don't remount read-only with errors=continue on reboot
        ext4: fix deadlock with fs freezing and EA inodes
        jbd2: add a helper to find out number of fast commit blocks
        ext4: make fast_commit.h byte identical with e2fsprogs/fast_commit.h
        ext4: fix fall-through warnings for Clang
        ext4: add docs about fast commit idempotence
        ext4: remove the unused EXT4_CURRENT_REV macro
        ext4: fix an IS_ERR() vs NULL check
        ext4: check for invalid block size early when mounting a file system
        ext4: fix a memory leak of ext4_free_data
        ext4: delete nonsensical (commented-out) code inside ext4_xattr_block_set()
        ext4: update ext4_data_block_valid related comments
        ...
      555a6e8c
    • Linus Torvalds's avatar
      Merge tag 'Smack-for-5.11-io_uring-fix' of git://github.com/cschaufler/smack-next · 2f2fce3d
      Linus Torvalds authored
      Pull smack fix from Casey Schaufler:
       "Provide a fix for the incorrect handling of privilege in the face of
        io_uring's use of kernel threads. That invalidated an long standing
        assumption regarding the privilege of kernel threads.
      
        The fix is simple and safe. It was provided by Jens Axboe and has been
        tested"
      
      * tag 'Smack-for-5.11-io_uring-fix' of git://github.com/cschaufler/smack-next:
        Smack: Handle io_uring kernel thread privileges
      2f2fce3d
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 7a2fde8d
      Linus Torvalds authored
      Pull RISC-V fix from Palmer Dabbelt
       "Avoid trying to initialize memory regions outside the usable range"
      
      * tag 'riscv-for-linus-5.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        RISC-V: Fix usage of memblock_enforce_memory_limit
      7a2fde8d
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 9b3f7f1b
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Four commits fixing various things in the new C VDSO code
      
       - One fix for a 32-bit VMAP stack bug
      
       - Two minor build fixes
      
      Thanks to Cédric Le Goater, Christophe Leroy, and Will Springer.
      
      * tag 'powerpc-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/32: Fix vmap stack - Properly set r1 before activating MMU on syscall too
        powerpc/vdso: Fix DOTSYM for 32-bit LE VDSO
        powerpc/vdso: Don't pass 64-bit ABI cflags to 32-bit VDSO
        powerpc/vdso: Block R_PPC_REL24 relocations
        powerpc/smp: Add __init to init_big_cores()
        powerpc/time: Force inlining of get_tb()
        powerpc/boot: Fix build of dts/fsl
      9b3f7f1b