1. 19 Jun, 2022 1 commit
    • Linus Torvalds's avatar
      Merge tag '5.19-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 · ace2045e
      Linus Torvalds authored
      Pull cifs client fixes from Steve French:
       "Two cifs debugging improvements - one found to deal with debugging a
        multichannel problem and one for a recent fallocate issue
      
        This does include the two larger multichannel reconnect (dynamically
        adjusting interfaces on reconnect) patches, because we recently found
        an additional problem with multichannel to one server type that I want
        to include at the same time"
      
      * tag '5.19-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: when a channel is not found for server, log its connection id
        smb3: add trace point for SMB2_set_eof
      ace2045e
  2. 18 Jun, 2022 1 commit
  3. 17 Jun, 2022 29 commits
  4. 16 Jun, 2022 9 commits
    • Mikulas Patocka's avatar
      dm mirror log: round up region bitmap size to BITS_PER_LONG · 85e123c2
      Mikulas Patocka authored
      The code in dm-log rounds up bitset_size to 32 bits. It then uses
      find_next_zero_bit_le on the allocated region. find_next_zero_bit_le
      accesses the bitmap using unsigned long pointers. So, on 64-bit
      architectures, it may access 4 bytes beyond the allocated size.
      
      Fix this bug by rounding up bitset_size to BITS_PER_LONG.
      
      This bug was found by running the lvm2 testsuite with kasan.
      
      Fixes: 29121bd0 ("[PATCH] dm mirror log: bitset_size fix")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      85e123c2
    • Mikulas Patocka's avatar
      dm: fix narrow race for REQ_NOWAIT bios being issued despite no support · 1ee88de3
      Mikulas Patocka authored
      Starting with the commit 63a225c9fd20, device mapper has an optimization
      that it will take cheaper table lock (dm_get_live_table_fast instead of
      dm_get_live_table) if the bio has REQ_NOWAIT. The bios with REQ_NOWAIT
      must not block in the target request routine, if they did, we would be
      blocking while holding rcu_read_lock, which is prohibited.
      
      The targets that are suitable for REQ_NOWAIT optimization (and that don't
      block in the map routine) have the flag DM_TARGET_NOWAIT set. Device
      mapper will test if all the targets and all the devices in a table
      support nowait (see the function dm_table_supports_nowait) and it will set
      or clear the QUEUE_FLAG_NOWAIT flag on its request queue according to
      this check.
      
      There's a test in submit_bio_noacct: "if ((bio->bi_opf & REQ_NOWAIT) &&
      !blk_queue_nowait(q)) goto not_supported" - this will make sure that
      REQ_NOWAIT bios can't enter a request queue that doesn't support them.
      
      This mechanism works to prevent REQ_NOWAIT bios from reaching dm targets
      that don't support the REQ_NOWAIT flag (and that may block in the map
      routine) - except that there is a small race condition:
      
      submit_bio_noacct checks if the queue has the QUEUE_FLAG_NOWAIT without
      holding any locks. Immediatelly after this check, the device mapper table
      may be reloaded with a table that doesn't support REQ_NOWAIT (for example,
      if we start moving the logical volume or if we activate a snapshot).
      However the REQ_NOWAIT bio that already passed the check in
      submit_bio_noacct would be sent to device mapper, where it could be
      redirected to a dm target that doesn't support REQ_NOWAIT - the result is
      sleeping while we hold rcu_read_lock.
      
      In order to fix this race, we double-check if the target supports
      REQ_NOWAIT while we hold the table lock (so that the table can't change
      under us).
      
      Fixes: 563a225c ("dm: introduce dm_{get,put}_live_table_bio called from dm_submit_bio")
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      1ee88de3
    • Mikulas Patocka's avatar
      dm: fix use-after-free in dm_put_live_table_bio · 5d7362d0
      Mikulas Patocka authored
      dm_put_live_table_bio is called from the end of dm_submit_bio.
      However, at this point, the bio may be already finished and the caller
      may have freed the bio. Consequently, dm_put_live_table_bio accesses
      the stale "bio" pointer.
      
      Fix this bug by loading the bi_opf value and passing it to
      dm_get_live_table_bio and dm_put_live_table_bio instead of the bio.
      
      This bug was found by running the lvm2 testsuite with kasan.
      
      Fixes: 563a225c ("dm: introduce dm_{get,put}_live_table_bio called from dm_submit_bio")
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      5d7362d0
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2022-06-16' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · 2f90ec12
      Dave Airlie authored
      Two fixes for TTM, one for a NULL pointer dereference and one to make sure
      the buffer is pinned prior to a bulk move, and a fix for a spurious
      compiler warning.
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Maxime Ripard <maxime@cerno.tech>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220616072519.qwrsefsemejefowu@houat
      2f90ec12
    • Steve French's avatar
      smb3: add trace point for SMB2_set_eof · 7c05eae8
      Steve French authored
      In order to debug problems with file size being reported incorrectly
      temporarily (in this case xfstest generic/584 intermittent failure)
      we need to add trace point for the non-compounded code path where
      we set the file size (SMB2_set_eof).  The new trace point is:
         "smb3_set_eof"
      
      Here is sample output from the tracepoint:
      
                  TASK-PID     CPU#  |||||  TIMESTAMP  FUNCTION
                    | |         |   |||||     |         |
                xfs_io-75403   [002] ..... 95219.189835: smb3_set_eof: xid=221 sid=0xeef1cbd2 tid=0x27079ee6 fid=0x52edb58c offset=0x100000
       aio-dio-append--75418   [010] ..... 95219.242402: smb3_set_eof: xid=226 sid=0xeef1cbd2 tid=0x27079ee6 fid=0xae89852d offset=0x0
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      7c05eae8
    • Bart Van Assche's avatar
      block/bfq: Enable I/O statistics · b96f3cab
      Bart Van Assche authored
      BFQ uses io_start_time_ns. That member variable is only set if I/O
      statistics are enabled. Hence this patch that enables I/O statistics
      at the time BFQ is associated with a request queue.
      
      Compile-tested only.
      Reported-by: default avatarCixi Geng <cixi.geng1@unisoc.com>
      Cc: Cixi Geng <cixi.geng1@unisoc.com>
      Cc: Yu Kuai <yukuai3@huawei.com>
      Cc: Paolo Valente <paolo.valente@unimore.it>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      b96f3cab
    • Linus Torvalds's avatar
      Merge tag 'audit-pr-20220616' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit · 0639b599
      Linus Torvalds authored
      Pull audit fix from Paul Moore:
       "A single audit patch to fix a problem where we were not properly
        freeing memory allocated when recording information related to a
        module load"
      
      * tag 'audit-pr-20220616' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit:
        audit: free module name
      0639b599
    • Linus Torvalds's avatar
      Merge tag 'selinux-pr-20220616' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux · 6decbf75
      Linus Torvalds authored
      Pull selinux fix from Paul Moore:
       "A single SELinux patch to fix memory leaks when mounting filesystems
        with SELinux mount options"
      
      * tag 'selinux-pr-20220616' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
        selinux: free contexts previously transferred in selinux_add_opt()
      6decbf75
    • Palmer Dabbelt's avatar
      RISC-V: Some Svpbmt fixes · c836d9d1
      Palmer Dabbelt authored
      Some additionals comments and notes from autobuilders received after the
      series got applied, warranted some changes.
      
      * commit '924cbb8c':
        riscv: Improve description for RISCV_ISA_SVPBMT Kconfig symbol
        riscv: drop cpufeature_apply_feature tracking variable
        riscv: fix dependency for t-head errata
      c836d9d1