1. 09 Jan, 2024 8 commits
    • Namjae Jeon's avatar
      ksmbd: don't allow O_TRUNC open on read-only share · d592a915
      Namjae Jeon authored
      When file is changed using notepad on read-only share(read_only = yes in
      ksmbd.conf), There is a problem where existing data is truncated.
      notepad in windows try to O_TRUNC open(FILE_OVERWRITE_IF) and all data
      in file is truncated. This patch don't allow  O_TRUNC open on read-only
      share and add KSMBD_TREE_CONN_FLAG_WRITABLE check in smb2_set_info().
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      d592a915
    • Randy Dunlap's avatar
      ksmbd: vfs: fix all kernel-doc warnings · 8d99c113
      Randy Dunlap authored
      Fix all kernel-doc warnings in vfs.c:
      
      vfs.c:54: warning: Function parameter or member 'parent' not described in 'ksmbd_vfs_lock_parent'
      vfs.c:54: warning: Function parameter or member 'child' not described in 'ksmbd_vfs_lock_parent'
      vfs.c:54: warning: No description found for return value of 'ksmbd_vfs_lock_parent'
      vfs.c:372: warning: Function parameter or member 'fp' not described in 'ksmbd_vfs_read'
      vfs.c:372: warning: Excess function parameter 'fid' description in 'ksmbd_vfs_read'
      vfs.c:489: warning: Function parameter or member 'fp' not described in 'ksmbd_vfs_write'
      vfs.c:489: warning: Excess function parameter 'fid' description in 'ksmbd_vfs_write'
      vfs.c:555: warning: Function parameter or member 'path' not described in 'ksmbd_vfs_getattr'
      vfs.c:555: warning: Function parameter or member 'stat' not described in 'ksmbd_vfs_getattr'
      vfs.c:555: warning: Excess function parameter 'work' description in 'ksmbd_vfs_getattr'
      vfs.c:555: warning: Excess function parameter 'fid' description in 'ksmbd_vfs_getattr'
      vfs.c:555: warning: Excess function parameter 'attrs' description in 'ksmbd_vfs_getattr'
      vfs.c:572: warning: Function parameter or member 'p_id' not described in 'ksmbd_vfs_fsync'
      vfs.c:595: warning: Function parameter or member 'work' not described in 'ksmbd_vfs_remove_file'
      vfs.c:595: warning: Function parameter or member 'path' not described in 'ksmbd_vfs_remove_file'
      vfs.c:595: warning: Excess function parameter 'name' description in 'ksmbd_vfs_remove_file'
      vfs.c:633: warning: Function parameter or member 'work' not described in 'ksmbd_vfs_link'
      vfs.c:805: warning: Function parameter or member 'fp' not described in 'ksmbd_vfs_truncate'
      vfs.c:805: warning: Excess function parameter 'fid' description in 'ksmbd_vfs_truncate'
      vfs.c:846: warning: Excess function parameter 'size' description in 'ksmbd_vfs_listxattr'
      vfs.c:953: warning: Function parameter or member 'option' not described in 'ksmbd_vfs_set_fadvise'
      vfs.c:953: warning: Excess function parameter 'options' description in 'ksmbd_vfs_set_fadvise'
      vfs.c:1167: warning: Function parameter or member 'um' not described in 'ksmbd_vfs_lookup_in_dir'
      vfs.c:1203: warning: Function parameter or member 'work' not described in 'ksmbd_vfs_kern_path_locked'
      vfs.c:1641: warning: No description found for return value of 'ksmbd_vfs_init_kstat'
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Namjae Jeon <linkinjeon@kernel.org>
      Cc: Steve French <sfrench@samba.org>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Tom Talpey <tom@talpey.com>
      Cc: linux-cifs@vger.kernel.org
      Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      8d99c113
    • Randy Dunlap's avatar
      ksmbd: auth: fix most kernel-doc warnings · b4068f1e
      Randy Dunlap authored
      Fix 12 of 17 kernel-doc warnings in auth.c:
      
      auth.c:221: warning: Function parameter or member 'conn' not described in 'ksmbd_auth_ntlmv2'
      auth.c:221: warning: Function parameter or member 'cryptkey' not described in 'ksmbd_auth_ntlmv2'
      auth.c:305: warning: Function parameter or member 'blob_len' not described in 'ksmbd_decode_ntlmssp_auth_blob'
      auth.c:305: warning: Function parameter or member 'conn' not described in 'ksmbd_decode_ntlmssp_auth_blob'
      auth.c:305: warning: Excess function parameter 'usr' description in 'ksmbd_decode_ntlmssp_auth_blob'
      auth.c:385: warning: Function parameter or member 'blob_len' not described in 'ksmbd_decode_ntlmssp_neg_blob'
      auth.c:385: warning: Function parameter or member 'conn' not described in 'ksmbd_decode_ntlmssp_neg_blob'
      auth.c:385: warning: Excess function parameter 'rsp' description in 'ksmbd_decode_ntlmssp_neg_blob'
      auth.c:385: warning: Excess function parameter 'sess' description in 'ksmbd_decode_ntlmssp_neg_blob'
      auth.c:413: warning: Function parameter or member 'conn' not described in 'ksmbd_build_ntlmssp_challenge_blob'
      auth.c:413: warning: Excess function parameter 'rsp' description in 'ksmbd_build_ntlmssp_challenge_blob'
      auth.c:413: warning: Excess function parameter 'sess' description in 'ksmbd_build_ntlmssp_challenge_blob'
      
      The other 5 are only present when a W=1 kernel build is done or
      when scripts/kernel-doc is run with -Wall. They are:
      
      auth.c:81: warning: No description found for return value of 'ksmbd_gen_sess_key'
      auth.c:385: warning: No description found for return value of 'ksmbd_decode_ntlmssp_neg_blob'
      auth.c:413: warning: No description found for return value of 'ksmbd_build_ntlmssp_challenge_blob'
      auth.c:577: warning: No description found for return value of 'ksmbd_sign_smb2_pdu'
      auth.c:628: warning: No description found for return value of 'ksmbd_sign_smb3_pdu'
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Namjae Jeon <linkinjeon@kernel.org>
      Cc: Steve French <sfrench@samba.org>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: Tom Talpey <tom@talpey.com>
      Cc: linux-cifs@vger.kernel.org
      Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      b4068f1e
    • Christophe JAILLET's avatar
      ksmbd: Remove usage of the deprecated ida_simple_xx() API · ebfee7ad
      Christophe JAILLET authored
      ida_alloc() and ida_free() should be preferred to the deprecated
      ida_simple_get() and ida_simple_remove().
      
      This is less verbose.
      
      Note that the upper limit of ida_simple_get() is exclusive, but the one of
      ida_alloc_range() is inclusive. So change a 0xFFFFFFFF into a 0xFFFFFFFE in
      order to keep the same behavior.
      Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
      Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      ebfee7ad
    • Namjae Jeon's avatar
      ksmbd: don't increment epoch if current state and request state are same · b6e9a44e
      Namjae Jeon authored
      If existing lease state and request state are same, don't increment
      epoch in create context.
      Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      b6e9a44e
    • Namjae Jeon's avatar
      ksmbd: fix potential circular locking issue in smb2_set_ea() · 6fc0a265
      Namjae Jeon authored
      smb2_set_ea() can be called in parent inode lock range.
      So add get_write argument to smb2_set_ea() not to call nested
      mnt_want_write().
      Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      6fc0a265
    • Namjae Jeon's avatar
      ksmbd: set v2 lease version on lease upgrade · bb05367a
      Namjae Jeon authored
      If file opened with v2 lease is upgraded with v1 lease, smb server
      should response v2 lease create context to client.
      This patch fix smb2.lease.v2_epoch2 test failure.
      
      This test case assumes the following scenario:
       1. smb2 create with v2 lease(R, LEASE1 key)
       2. smb server return smb2 create response with v2 lease context(R,
      LEASE1 key, epoch + 1)
       3. smb2 create with v1 lease(RH, LEASE1 key)
       4. smb server return smb2 create response with v2 lease context(RH,
      LEASE1 key, epoch + 2)
      
      i.e. If same client(same lease key) try to open a file that is being
      opened with v2 lease with v1 lease, smb server should return v2 lease.
      Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Acked-by: default avatarTom Talpey <tom@talpey.com>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      bb05367a
    • Li Nan's avatar
      ksmbd: validate the zero field of packet header · 516b3eb8
      Li Nan authored
      The SMB2 Protocol requires that "The first byte of the Direct TCP
      transport packet header MUST be zero (0x00)"[1]. Commit 1c1bcf2d
      ("ksmbd: validate smb request protocol id") removed the validation of
      this 1-byte zero. Add the validation back now.
      
      [1]: [MS-SMB2] - v20230227, page 30.
      https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-SMB2/%5bMS-SMB2%5d-230227.pdf
      
      Fixes: 1c1bcf2d ("ksmbd: validate smb request protocol id")
      Signed-off-by: default avatarLi Nan <linan122@huawei.com>
      Acked-by: default avatarTom Talpey <tom@talpey.com>
      Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      516b3eb8
  2. 07 Jan, 2024 1 commit
  3. 06 Jan, 2024 2 commits
  4. 05 Jan, 2024 25 commits
  5. 04 Jan, 2024 4 commits
    • Linus Torvalds's avatar
      x86/csum: clean up `csum_partial' further · a476aae3
      Linus Torvalds authored
      Commit 688eb819 ("x86/csum: Improve performance of `csum_partial`")
      ended up improving the code generation for the IP csum calculations, and
      in particular special-casing the 40-byte case that is a hot case for
      IPv6 headers.
      
      It then had _another_ special case for the 64-byte unrolled loop, which
      did two chains of 32-byte blocks, which allows modern CPU's to improve
      performance by doing the chains in parallel thanks to renaming the carry
      flag.
      
      This just unifies the special cases and combines them into just one
      single helper the 40-byte csum case, and replaces the 64-byte case by a
      80-byte case that just does that single helper twice.  It avoids having
      all these different versions of inline assembly, and actually improved
      performance further in my tests.
      
      There was never anything magical about the 64-byte unrolled case, even
      though it happens to be a common size (and typically is the cacheline
      size).
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a476aae3
    • Noah Goldstein's avatar
      x86/csum: Remove unnecessary odd handling · 5d4acb62
      Noah Goldstein authored
      The special case for odd aligned buffers is unnecessary and mostly
      just adds overhead. Aligned buffers is the expectations, and even for
      unaligned buffer, the only case that was helped is if the buffer was
      1-byte from word aligned which is ~1/7 of the cases. Overall it seems
      highly unlikely to be worth to extra branch.
      
      It was left in the previous perf improvement patch because I was
      erroneously comparing the exact output of `csum_partial(...)`, but
      really we only need `csum_fold(csum_partial(...))` to match so its
      safe to remove.
      
      All csum kunit tests pass.
      Signed-off-by: default avatarNoah Goldstein <goldstein.w.n@gmail.com>
      Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
      Reviewed-by: default avatarDavid Laight <david.laight@aculab.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5d4acb62
    • Linus Torvalds's avatar
      Merge tag 'platform-drivers-x86-v6.7-7' of... · 5eff55d7
      Linus Torvalds authored
      Merge tag 'platform-drivers-x86-v6.7-7' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86
      
      Pull x86 platform driver fix from Ilpo Järvinen:
       "Unfortunately the P2SB deadlock fix broke some older HW and we need
        some time to figure out the best way to fix the issue so reverting the
        deadlock fix for now"
      
      * tag 'platform-drivers-x86-v6.7-7' of git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86:
        Revert "platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe"
      5eff55d7
    • Linus Torvalds's avatar
      Merge tag 'sound-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 08bd31ec
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "It became more than wished, partly because of vacations. But all
        changes are fairly device-specific and should be safe to apply:
      
         - A regression fix for Oops at ASoC HD-audio probe
      
         - A series of TAS2781 HD-audio codec fixes
      
         - A random build regression fix with SPI helpers
      
         - Minor endianness fix for USB-audio mixer code
      
         - ASoC FSL driver error handling fix
      
         - ASoC Mediatek driver register fix
      
         - A series of ASoC meson g12a driver fixes
      
         - A few usual HD-audio oneliner quirks"
      
      * tag 'sound-6.7-final' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ALSA: hda/realtek: Fix mute and mic-mute LEDs for HP ProBook 440 G6
        ASoC: meson: g12a-tohdmitx: Fix event generation for S/PDIF mux
        ASoC: meson: g12a-toacodec: Fix event generation
        ASoC: meson: g12a-tohdmitx: Validate written enum values
        ASoC: meson: g12a-toacodec: Validate written enum values
        ASoC: SOF: Intel: hda-codec: Delay the codec device registration
        ALSA: hda: cs35l41: fix building without CONFIG_SPI
        ALSA: hda/realtek: fix mute/micmute LEDs for a HP ZBook
        ALSA: hda/realtek: enable SND_PCI_QUIRK for hp pavilion 14-ec1xxx series
        ASoC: mediatek: mt8186: fix AUD_PAD_TOP register and offset
        ALSA: scarlett2: Convert meter levels from little-endian
        ALSA: hda/tas2781: remove sound controls in unbind
        ALSA: hda/tas2781: move set_drv_data outside tasdevice_init
        ALSA: hda/tas2781: fix typos in comment
        ALSA: hda/tas2781: do not use regcache
        ASoC: fsl_rpmsg: Fix error handler with pm_runtime_enable
      08bd31ec