1. 16 May, 2023 4 commits
    • Gustav Johansson's avatar
      ksmbd: smb2: Allow messages padded to 8byte boundary · e7b8b8ed
      Gustav Johansson authored
      clc length is now accepted to <= 8 less than length,
      rather than < 8.
      
      Solve issues on some of Axis's smb clients which send
      messages where clc length is 8 bytes less than length.
      
      The specific client was running kernel 4.19.217 with
      smb dialect 3.0.2 on armv7l.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarGustav Johansson <gustajo@axis.com>
      Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      e7b8b8ed
    • Chih-Yen Chang's avatar
      ksmbd: allocate one more byte for implied bcc[0] · 443d61d1
      Chih-Yen Chang authored
      ksmbd_smb2_check_message allows client to return one byte more, so we
      need to allocate additional memory in ksmbd_conn_handler_loop to avoid
      out-of-bound access.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarChih-Yen Chang <cc85nod@gmail.com>
      Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      443d61d1
    • Chih-Yen Chang's avatar
      ksmbd: fix wrong UserName check in session_user · f0a96d1a
      Chih-Yen Chang authored
      The offset of UserName is related to the address of security
      buffer. To ensure the validaty of UserName, we need to compare name_off
      + name_len with secbuf_len instead of auth_msg_len.
      
      [   27.096243] ==================================================================
      [   27.096890] BUG: KASAN: slab-out-of-bounds in smb_strndup_from_utf16+0x188/0x350
      [   27.097609] Read of size 2 at addr ffff888005e3b542 by task kworker/0:0/7
      ...
      [   27.099950] Call Trace:
      [   27.100194]  <TASK>
      [   27.100397]  dump_stack_lvl+0x33/0x50
      [   27.100752]  print_report+0xcc/0x620
      [   27.102305]  kasan_report+0xae/0xe0
      [   27.103072]  kasan_check_range+0x35/0x1b0
      [   27.103757]  smb_strndup_from_utf16+0x188/0x350
      [   27.105474]  smb2_sess_setup+0xaf8/0x19c0
      [   27.107935]  handle_ksmbd_work+0x274/0x810
      [   27.108315]  process_one_work+0x419/0x760
      [   27.108689]  worker_thread+0x2a2/0x6f0
      [   27.109385]  kthread+0x160/0x190
      [   27.110129]  ret_from_fork+0x1f/0x30
      [   27.110454]  </TASK>
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarChih-Yen Chang <cc85nod@gmail.com>
      Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      f0a96d1a
    • Chih-Yen Chang's avatar
      ksmbd: fix global-out-of-bounds in smb2_find_context_vals · 02f76c40
      Chih-Yen Chang authored
      Add tag_len argument in smb2_find_context_vals() to avoid out-of-bound
      read when create_context's name_len is larger than tag length.
      
      [    7.995411] ==================================================================
      [    7.995866] BUG: KASAN: global-out-of-bounds in memcmp+0x83/0xa0
      [    7.996248] Read of size 8 at addr ffffffff8258d940 by task kworker/0:0/7
      ...
      [    7.998191] Call Trace:
      [    7.998358]  <TASK>
      [    7.998503]  dump_stack_lvl+0x33/0x50
      [    7.998743]  print_report+0xcc/0x620
      [    7.999458]  kasan_report+0xae/0xe0
      [    7.999895]  kasan_check_range+0x35/0x1b0
      [    8.000152]  memcmp+0x83/0xa0
      [    8.000347]  smb2_find_context_vals+0xf7/0x1e0
      [    8.000635]  smb2_open+0x1df2/0x43a0
      [    8.006398]  handle_ksmbd_work+0x274/0x810
      [    8.006666]  process_one_work+0x419/0x760
      [    8.006922]  worker_thread+0x2a2/0x6f0
      [    8.007429]  kthread+0x160/0x190
      [    8.007946]  ret_from_fork+0x1f/0x30
      [    8.008181]  </TASK>
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarChih-Yen Chang <cc85nod@gmail.com>
      Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      02f76c40
  2. 14 May, 2023 13 commits
  3. 13 May, 2023 17 commits
  4. 12 May, 2023 6 commits
    • Borislav Petkov (AMD)'s avatar
      x86/retbleed: Fix return thunk alignment · 9a48d604
      Borislav Petkov (AMD) authored
      SYM_FUNC_START_LOCAL_NOALIGN() adds an endbr leading to this layout
      (leaving only the last 2 bytes of the address):
      
        3bff <zen_untrain_ret>:
        3bff:       f3 0f 1e fa             endbr64
        3c03:       f6                      test   $0xcc,%bl
      
        3c04 <__x86_return_thunk>:
        3c04:       c3                      ret
        3c05:       cc                      int3
        3c06:       0f ae e8                lfence
      
      However, "the RET at __x86_return_thunk must be on a 64 byte boundary,
      for alignment within the BTB."
      
      Use SYM_START instead.
      Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: <stable@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9a48d604
    • Linus Torvalds's avatar
      Merge tag 'for-6.4-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 76c7f887
      Linus Torvalds authored
      Pull more btrfs fixes from David Sterba:
      
       - fix incorrect number of bitmap entries for space cache if loading is
         interrupted by some error
      
       - fix backref walking, this breaks a mode of LOGICAL_INO_V2 ioctl that
         is used in deduplication tools
      
       - zoned mode fixes:
            - properly finish zone reserved for relocation
            - correctly calculate super block zone end on ZNS
            - properly initialize new extent buffer for redirty
      
       - make mount option clear_cache work with block-group-tree, to rebuild
         free-space-tree instead of temporarily disabling it that would lead
         to a forced read-only mount
      
       - fix alignment check for offset when printing extent item
      
      * tag 'for-6.4-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: make clear_cache mount option to rebuild FST without disabling it
        btrfs: zero the buffer before marking it dirty in btrfs_redirty_list_add
        btrfs: zoned: fix full zone super block reading on ZNS
        btrfs: zoned: zone finish data relocation BG with last IO
        btrfs: fix backref walking not returning all inode refs
        btrfs: fix space cache inconsistency after error loading it from disk
        btrfs: print-tree: parent bytenr must be aligned to sector size
      76c7f887
    • Linus Torvalds's avatar
      Merge tag '6.4-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 · fd88f147
      Linus Torvalds authored
      Pull cifs client fixes from Steve French:
      
       - fix for copy_file_range bug for very large files that are multiples
         of rsize
      
       - do not ignore "isolated transport" flag if set on share
      
       - set rasize default better
      
       - three fixes related to shutdown and freezing (fixes 4 xfstests, and
         closes deferred handles faster in some places that were missed)
      
      * tag '6.4-rc1-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: release leases for deferred close handles when freezing
        smb3: fix problem remounting a share after shutdown
        SMB3: force unmount was failing to close deferred close files
        smb3: improve parallel reads of large files
        do not reuse connection if share marked as isolated
        cifs: fix pcchunk length type in smb2_copychunk_range
      fd88f147
    • Linus Torvalds's avatar
      Merge tag 'vfs/v6.4-rc1/pipe' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs · df8c2d13
      Linus Torvalds authored
      Pull vfs fix from Christian Brauner:
       "During the pipe nonblock rework the check for both O_NONBLOCK and
        IOCB_NOWAIT was dropped. Both checks need to be performed to ensure
        that files without O_NONBLOCK but IOCB_NOWAIT don't block when writing
        to or reading from a pipe.
      
        This just contains the fix adding the check for IOCB_NOWAIT back in"
      
      * tag 'vfs/v6.4-rc1/pipe' of gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs:
        pipe: check for IOCB_NOWAIT alongside O_NONBLOCK
      df8c2d13
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.4-2023-05-12' of git://git.kernel.dk/linux · 584dc5db
      Linus Torvalds authored
      Pull io_uring fix from Jens Axboe:
       "Just a single fix making io_uring_sqe_cmd() available regardless of
        CONFIG_IO_URING, fixing a regression introduced during the merge
        window if nvme was selected but io_uring was not"
      
      * tag 'io_uring-6.4-2023-05-12' of git://git.kernel.dk/linux:
        io_uring: make io_uring_sqe_cmd() unconditionally available
      584dc5db
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-6.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · ed6a75e3
      Linus Torvalds authored
      Pull RISC-V fix from Palmer Dabbelt:
       "Just a single fix this week for a build issue. That'd usually be a
        good sign, but we've started to get some reports of boot failures on
        some hardware/bootloader configurations. Nothing concrete yet, but
        I've got a funny feeling that's where much of the bug hunting is going
        right now.
      
        Nothing's reproducing on my end, though, and this fixes some pretty
        concrete issues so I figured there's no reason to delay it:
      
         - a fix to the linker script to avoid orpahaned sections in
           kernel/pi"
      
      * tag 'riscv-for-linus-6.4-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: Fix orphan section warnings caused by kernel/pi
      ed6a75e3