1. 01 Aug, 2022 4 commits
    • Namjae Jeon's avatar
      ksmbd: fix use-after-free bug in smb2_tree_disconect · cf6531d9
      Namjae Jeon authored
      smb2_tree_disconnect() freed the struct ksmbd_tree_connect,
      but it left the dangling pointer. It can be accessed
      again under compound requests.
      
      This bug can lead an oops looking something link:
      
      [ 1685.468014 ] BUG: KASAN: use-after-free in ksmbd_tree_conn_disconnect+0x131/0x160 [ksmbd]
      [ 1685.468068 ] Read of size 4 at addr ffff888102172180 by task kworker/1:2/4807
      ...
      [ 1685.468130 ] Call Trace:
      [ 1685.468132 ]  <TASK>
      [ 1685.468135 ]  dump_stack_lvl+0x49/0x5f
      [ 1685.468141 ]  print_report.cold+0x5e/0x5cf
      [ 1685.468145 ]  ? ksmbd_tree_conn_disconnect+0x131/0x160 [ksmbd]
      [ 1685.468157 ]  kasan_report+0xaa/0x120
      [ 1685.468194 ]  ? ksmbd_tree_conn_disconnect+0x131/0x160 [ksmbd]
      [ 1685.468206 ]  __asan_report_load4_noabort+0x14/0x20
      [ 1685.468210 ]  ksmbd_tree_conn_disconnect+0x131/0x160 [ksmbd]
      [ 1685.468222 ]  smb2_tree_disconnect+0x175/0x250 [ksmbd]
      [ 1685.468235 ]  handle_ksmbd_work+0x30e/0x1020 [ksmbd]
      [ 1685.468247 ]  process_one_work+0x778/0x11c0
      [ 1685.468251 ]  ? _raw_spin_lock_irq+0x8e/0xe0
      [ 1685.468289 ]  worker_thread+0x544/0x1180
      [ 1685.468293 ]  ? __cpuidle_text_end+0x4/0x4
      [ 1685.468297 ]  kthread+0x282/0x320
      [ 1685.468301 ]  ? process_one_work+0x11c0/0x11c0
      [ 1685.468305 ]  ? kthread_complete_and_exit+0x30/0x30
      [ 1685.468309 ]  ret_from_fork+0x1f/0x30
      
      Fixes: e2f34481 ("cifsd: add server-side procedures for SMB3")
      Cc: stable@vger.kernel.org
      Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-17816
      Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Reviewed-by: default avatarHyunchul Lee <hyc.lee@gmail.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      cf6531d9
    • Namjae Jeon's avatar
      ksmbd: fix memory leak in smb2_handle_negotiate · aa7253c2
      Namjae Jeon authored
      The allocated memory didn't free under an error
      path in smb2_handle_negotiate().
      
      Fixes: e2f34481 ("cifsd: add server-side procedures for SMB3")
      Cc: stable@vger.kernel.org
      Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-17815
      Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Reviewed-by: default avatarHyunchul Lee <hyc.lee@gmail.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      aa7253c2
    • Namjae Jeon's avatar
      ksmbd: fix racy issue while destroying session on multichannel · af7c39d9
      Namjae Jeon authored
      After multi-channel connection with windows, Several channels of
      session are connected. Among them, if there is a problem in one channel,
      Windows connects again after disconnecting the channel. In this process,
      the session is released and a kernel oop can occurs while processing
      requests to other channels. When the channel is disconnected, if other
      channels still exist in the session after deleting the channel from
      the channel list in the session, the session should not be released.
      Finally, the session will be released after all channels are disconnected.
      Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Reviewed-by: default avatarHyunchul Lee <hyc.lee@gmail.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      af7c39d9
    • Namjae Jeon's avatar
      ksmbd: use wait_event instead of schedule_timeout() · a14c5738
      Namjae Jeon authored
      ksmbd threads eating masses of cputime when connection is disconnected.
      If connection is disconnected, ksmbd thread waits for pending requests
      to be processed using schedule_timeout. schedule_timeout() incorrectly
      is used, and it is more efficient to use wait_event/wake_up than to check
      r_count every time with timeout.
      Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Reviewed-by: default avatarHyunchul Lee <hyc.lee@gmail.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      a14c5738
  2. 27 Jul, 2022 3 commits
  3. 24 Jul, 2022 2 commits
  4. 17 Jul, 2022 15 commits
  5. 16 Jul, 2022 12 commits
  6. 15 Jul, 2022 4 commits
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 9b59ec8d
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
      
       - A fix to avoid printing a warning when modules do not exercise any
         errata-dependent behavior and the SiFive errata are enabled.
      
       - A fix to the Microchip PFSOC to attach the L2 cache to the CPU nodes.
      
      * tag 'riscv-for-linus-5.19-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: don't warn for sifive erratas in modules
        riscv: dts: microchip: hook up the mpfs' l2cache
      9b59ec8d
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · a8ebfcd3
      Linus Torvalds authored
      Pull KVM fixes from Paolo Bonzini:
       "RISC-V:
         - Fix missing PAGE_PFN_MASK
      
         - Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests()
      
        x86:
         - Fix for nested virtualization when TSC scaling is active
      
         - Estimate the size of fastcc subroutines conservatively, avoiding
           disastrous underestimation when return thunks are enabled
      
         - Avoid possible use of uninitialized fields of 'struct
           kvm_lapic_irq'
      
        Generic:
         - Mark as such the boolean values available from the statistics file
           descriptors
      
         - Clarify statistics documentation"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: emulate: do not adjust size of fastop and setcc subroutines
        KVM: x86: Fully initialize 'struct kvm_lapic_irq' in kvm_pv_kick_cpu_op()
        Documentation: kvm: clarify histogram units
        kvm: stats: tell userspace which values are boolean
        x86/kvm: fix FASTOP_SIZE when return thunks are enabled
        KVM: nVMX: Always enable TSC scaling for L2 when it was enabled for L1
        RISC-V: KVM: Fix SRCU deadlock caused by kvm_riscv_check_vcpu_requests()
        riscv: Fix missing PAGE_PFN_MASK
      a8ebfcd3
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-5.19-rc7' of https://github.com/ceph/ceph-client · 1ce9d792
      Linus Torvalds authored
      Pull ceph fix from Ilya Dryomov:
       "A folio locking fixup that Xiubo and David cooperated on, marked for
        stable. Most of it is in netfs but I picked it up into ceph tree on
        agreement with David"
      
      * tag 'ceph-for-5.19-rc7' of https://github.com/ceph/ceph-client:
        netfs: do not unlock and put the folio twice
      1ce9d792
    • Linus Torvalds's avatar
      Merge tag 'spi-fix-v5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi · 8006112d
      Linus Torvalds authored
      Pull spi fixes from Mark Brown:
       "A few driver specific fixes, none especially remarkable, plus a
        MAINTAINERS file update due to the previous maintainer for the NXP
        FSPI driver having left the company"
      
      * tag 'spi-fix-v5.19-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
        spi: cadence-quadspi: Remove spi_master_put() in probe failure path
        MAINTAINERS: change the NXP FSPI driver maintainer.
        spi: amd: Limit max transfer and message size
        spi: aspeed: Fix division by zero
        spi: aspeed: Add dev_dbg() to dump the spi-mem direct mapping descriptor
      8006112d