1. 27 9月, 2021 1 次提交
    • R
      ksmbd: remove RFC1002 check in smb2 request · 18d46769
      Ronnie Sahlberg 提交于
      In smb_common.c you have this function :   ksmbd_smb_request() which
      is called from connection.c once you have read the initial 4 bytes for
      the next length+smb2 blob.
      
      It checks the first byte of this 4 byte preamble for valid values,
      i.e. a NETBIOSoverTCP SESSION_MESSAGE or a SESSION_KEEP_ALIVE.
      
      We don't need to check this for ksmbd since it only implements SMB2
      over TCP port 445.
      The netbios stuff was only used in very old servers when SMB ran over
      TCP port 139.
      Now that we run over TCP port 445, this is actually not a NB header anymore
      and you can just treat it as a 4 byte length field that must be less
      than 16Mbyte. and remove the references to the RFC1002 constants that no
      longer applies.
      
      Cc: Tom Talpey <tom@talpey.com>
      Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
      Cc: Ralph Böhme <slow@samba.org>
      Cc: Steve French <smfrench@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Acked-by: NHyunchul Lee <hyc.lee@gmail.com>
      Signed-off-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      18d46769
  2. 25 9月, 2021 1 次提交
  3. 23 9月, 2021 2 次提交
  4. 22 9月, 2021 2 次提交
  5. 18 9月, 2021 2 次提交
  6. 17 9月, 2021 1 次提交
  7. 09 9月, 2021 3 次提交
  8. 04 9月, 2021 15 次提交
    • N
      ksmbd: add validation for ndr read/write functions · 303fff2b
      Namjae Jeon 提交于
      If ndr->length is smaller than expected size, ksmbd can access invalid
      access in ndr->data. This patch add validation to check ndr->offset is
      over ndr->length. and added exception handling to check return value of
      ndr read/write function.
      
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      303fff2b
    • N
      ksmbd: remove unused ksmbd_file_table_flush function · 687c59e7
      Namjae Jeon 提交于
      ksmbd_file_table_flush is a leftover from SMB1. This function is no longer
      needed as SMB1 has been removed from ksmbd.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      687c59e7
    • H
      ksmbd: smbd: fix dma mapping error in smb_direct_post_send_data · 72d6cbb5
      Hyunchul Lee 提交于
      Becase smb direct header is mapped and msg->num_sge
      already is incremented, the decrement should be
      removed from the condition.
      Signed-off-by: NHyunchul Lee <hyc.lee@gmail.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      72d6cbb5
    • P
      ksmbd: Reduce error log 'speed is unknown' to debug · d475866e
      Per Forlin 提交于
      This log happens on servers with a network bridge since
      the bridge does not have a specified link speed.
      This is not a real error so change the error log to debug instead.
      Signed-off-by: NPer Forlin <perfn@axis.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      d475866e
    • C
      ksmbd: defer notify_change() call · 28a5d3de
      Christian Brauner 提交于
      When ownership is changed we might in certain scenarios loose the
      ability to alter the inode after we changed ownership. This can e.g.
      happen when we are on an idmapped mount where uid 0 is mapped to uid
      1000 and uid 1000 is mapped to uid 0.
      A caller with fs*id 1000 will be able to create files as *id 1000 on
      disk. They will also be able to change ownership of files owned by *id 0
      to *id 1000 but they won't be able to change ownership in the other
      direction. This means acl operations following notify_change() would
      fail. Move the notify_change() call after the acls have been updated.
      This guarantees that we don't end up with spurious "hash value diff"
      warnings later on because we managed to change ownership but didn't
      manage to alter acls.
      
      Cc: Steve French <stfrench@microsoft.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Hyunchul Lee <hyc.lee@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: linux-cifs@vger.kernel.org
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      28a5d3de
    • C
      ksmbd: remove setattr preparations in set_file_basic_info() · db7fb6fe
      Christian Brauner 提交于
      Permission checking and copying over ownership information is the task
      of the underlying filesystem not ksmbd. The order is also wrong here.
      This modifies the inode before notify_change(). If notify_change() fails
      this will have changed ownership nonetheless. All of this is unnecessary
      though since the underlying filesystem's ->setattr handler will do all
      this (if required) by itself.
      
      Cc: Steve French <stfrench@microsoft.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Hyunchul Lee <hyc.lee@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: linux-cifs@vger.kernel.org
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      db7fb6fe
    • C
      ksmbd: ensure error is surfaced in set_file_basic_info() · eb5784f0
      Christian Brauner 提交于
      It seems the error was accidently ignored until now. Make sure it is
      surfaced.
      
      Cc: Steve French <stfrench@microsoft.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Hyunchul Lee <hyc.lee@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: linux-cifs@vger.kernel.org
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      eb5784f0
    • C
      ndr: fix translation in ndr_encode_posix_acl() · 9467a0ce
      Christian Brauner 提交于
      The sid_to_id() helper encodes raw ownership information suitable for
      s*id handling. This is conceptually equivalent to reporting ownership
      information via stat to userspace. In this case the consumer is ksmbd
      instead of a regular user. So when encoding raw ownership information
      suitable for s*id handling later we need to map the id up according to
      the user namespace of ksmbd itself taking any idmapped mounts into
      account.
      
      Cc: Steve French <stfrench@microsoft.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Hyunchul Lee <hyc.lee@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: linux-cifs@vger.kernel.org
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      9467a0ce
    • C
      ksmbd: fix translation in sid_to_id() · 55cd04d7
      Christian Brauner 提交于
      The sid_to_id() functions is relevant when changing ownership of
      filesystem objects based on acl information. In this case we need to
      first translate the relevant s*ids into k*ids in ksmbd's user namespace
      and account for any idmapped mounts. Requesting a change in ownership
      requires the inverse translation to be applied when we would report
      ownership to userspace. So k*id_from_mnt() must be used here.
      
      Cc: Steve French <stfrench@microsoft.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Hyunchul Lee <hyc.lee@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: linux-cifs@vger.kernel.org
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      55cd04d7
    • C
      ksmbd: fix subauth 0 handling in sid_to_id() · f0bb29d5
      Christian Brauner 提交于
      It's not obvious why subauth 0 would be excluded from translation. This
      would lead to wrong results whenever a non-identity idmapping is used.
      
      Cc: Steve French <stfrench@microsoft.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Hyunchul Lee <hyc.lee@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: linux-cifs@vger.kernel.org
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      f0bb29d5
    • C
      ksmbd: fix translation in acl entries · 0e844efe
      Christian Brauner 提交于
      The ksmbd server performs translation of posix acls to smb acls.
      Currently the translation is wrong since the idmapping of the mount is
      used to map the ids into raw userspace ids but what is relevant is the
      user namespace of ksmbd itself. The user namespace of ksmbd itself which
      is the initial user namespace. The operation is similar to asking "What
      *ids would a userspace process see given that k*id in the relevant user
      namespace?". Before the final translation we need to apply the idmapping
      of the mount in case any is used. Add two simple helpers for ksmbd.
      
      Cc: Steve French <stfrench@microsoft.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Hyunchul Lee <hyc.lee@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: linux-cifs@vger.kernel.org
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      0e844efe
    • C
      ksmbd: fix translation in ksmbd_acls_fattr() · 43205ca7
      Christian Brauner 提交于
      When creating new filesystem objects ksmbd translates between k*ids and
      s*ids. For this it often uses struct smb_fattr and stashes the k*ids in
      cf_uid and cf_gid. Let cf_uid and cf_gid always contain the final
      information taking any potential idmapped mounts into account. When
      finally translation cf_*id into s*ids translate them into the user
      namespace of ksmbd since that is the relevant user namespace here.
      
      Cc: Steve French <stfrench@microsoft.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Hyunchul Lee <hyc.lee@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: linux-cifs@vger.kernel.org
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      43205ca7
    • C
      ksmbd: fix translation in create_posix_rsp_buf() · 3cdc20e7
      Christian Brauner 提交于
      When transferring ownership information to the client the k*ids are
      translated into raw *ids before they are sent over the wire. The
      function currently erroneously translates the k*ids according to the
      mount's idmapping. Instead, reporting the owning *ids to userspace the
      underlying k*ids need to be mapped up in the caller's user namespace.
      This is how stat() works.
      The caller in this instance is ksmbd itself and ksmbd always runs in the
      initial user namespace. Translate according to that taking any potential
      idmapped mounts into account.
      
      Switch to from_k*id_munged() which ensures that the overflow*id is
      returned instead of the (*id_t)-1 when the k*id can't be translated.
      
      Cc: Steve French <stfrench@microsoft.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Hyunchul Lee <hyc.lee@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: linux-cifs@vger.kernel.org
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      3cdc20e7
    • C
      ksmbd: fix translation in smb2_populate_readdir_entry() · 475d6f98
      Christian Brauner 提交于
      When transferring ownership information to the
      client the k*ids are translated into raw *ids before they are sent over
      the wire. The function currently erroneously translates the k*ids
      according to the mount's idmapping. Instead, reporting the owning *ids
      to userspace the underlying k*ids need to be mapped up in the caller's
      user namespace. This is how stat() works.
      The caller in this instance is ksmbd itself and ksmbd always runs in the
      initial user namespace. Translate according to that.
      
      The idmapping of the mount is already taken into account by the lower
      filesystem and so kstat->*id will contain the mapped k*ids.
      
      Switch to from_k*id_munged() which ensures that the overflow*id is
      returned instead of the (*id_t)-1 when the k*id can't be translated.
      
      Cc: Steve French <stfrench@microsoft.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Hyunchul Lee <hyc.lee@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: linux-cifs@vger.kernel.org
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      475d6f98
    • C
      ksmbd: fix lookup on idmapped mounts · da1e7ada
      Christian Brauner 提交于
      It's great that the new in-kernel ksmbd server will support idmapped
      mounts out of the box! However, lookup is currently broken. Lookup
      helpers such as lookup_one_len() call inode_permission() internally to
      ensure that the caller is privileged over the inode of the base dentry
      they are trying to lookup under. So the permission checking here is
      currently wrong.
      
      Linux v5.15 will gain a new lookup helper lookup_one() that does take
      idmappings into account. I've added it as part of my patch series to
      make btrfs support idmapped mounts. The new helper is in linux-next as
      part of David's (Sterba) btrfs for-next branch as commit
      c972214c133b ("namei: add mapping aware lookup helper").
      
      I've said it before during one of my first reviews: I would very much
      recommend adding fstests to [1]. It already seems to have very
      rudimentary cifs support. There is a completely generic idmapped mount
      testsuite that supports idmapped mounts.
      
      [1]: https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/
      Cc: Colin Ian King <colin.king@canonical.com>
      Cc: Steve French <stfrench@microsoft.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Namjae Jeon <namjae.jeon@samsung.com>
      Cc: Hyunchul Lee <hyc.lee@gmail.com>
      Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
      Cc: David Sterba <dsterba@suse.com>
      Cc: linux-cifs@vger.kernel.org
      Signed-off-by: NChristian Brauner <christian.brauner@ubuntu.com>
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      da1e7ada
  9. 28 8月, 2021 1 次提交
    • N
      ksmbd: fix __write_overflow warning in ndr_read_string · 7d5d8d71
      Namjae Jeon 提交于
      Dan reported __write_overflow warning in ndr_read_string.
      
        CC [M]  fs/ksmbd/ndr.o
      In file included from ./include/linux/string.h:253,
                       from ./include/linux/bitmap.h:11,
                       from ./include/linux/cpumask.h:12,
                       from ./arch/x86/include/asm/cpumask.h:5,
                       from ./arch/x86/include/asm/msr.h:11,
                       from ./arch/x86/include/asm/processor.h:22,
                       from ./arch/x86/include/asm/cpufeature.h:5,
                       from ./arch/x86/include/asm/thread_info.h:53,
                       from ./include/linux/thread_info.h:60,
                       from ./arch/x86/include/asm/preempt.h:7,
                       from ./include/linux/preempt.h:78,
                       from ./include/linux/spinlock.h:55,
                       from ./include/linux/wait.h:9,
                       from ./include/linux/wait_bit.h:8,
                       from ./include/linux/fs.h:6,
                       from fs/ksmbd/ndr.c:7:
      In function memcpy,
          inlined from ndr_read_string at fs/ksmbd/ndr.c:86:2,
          inlined from ndr_decode_dos_attr at fs/ksmbd/ndr.c:167:2:
      ./include/linux/fortify-string.h:219:4: error: call to __write_overflow
      declared with attribute error: detected write beyond size of object
          __write_overflow();
          ^~~~~~~~~~~~~~~~~~
      
      This seems to be a false alarm because hex_attr size is always smaller
      than n->length. This patch fix this warning by allocation hex_attr with
      n->length.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      7d5d8d71
  10. 21 8月, 2021 1 次提交
  11. 20 8月, 2021 1 次提交
  12. 13 8月, 2021 6 次提交
    • H
      ksmbd: smbd: fix kernel oops during server shutdown · 323b1ea1
      Hyunchul Lee 提交于
      if server shutdown happens in the situation that
      there are connections, workqueue could be destroyed
      before queueing disconnect work.
      Signed-off-by: NHyunchul Lee <hyc.lee@gmail.com>
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      323b1ea1
    • N
      ksmbd: remove select FS_POSIX_ACL in Kconfig · 777cad16
      Namjae Jeon 提交于
      ksmbd is forcing to turn on FS_POSIX_ACL in Kconfig to use vfs acl
      functions(posix_acl_alloc, get_acl, set_posix_acl). OpenWRT and other
      platform doesn't use acl and this config is disable by default in
      kernel. This patch use IS_ENABLED() to know acl config is enable and use
      acl function if it is enable.
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      777cad16
    • N
      ksmbd: use proper errno instead of -1 in smb2_get_ksmbd_tcon() · c6ce2b57
      Namjae Jeon 提交于
      Use proper errno instead of -1 in smb2_get_ksmbd_tcon().
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      c6ce2b57
    • N
      ksmbd: update the comment for smb2_get_ksmbd_tcon() · 5ec3df8e
      Namjae Jeon 提交于
      Update the comment for smb2_get_ksmbd_tcon().
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      5ec3df8e
    • N
      ksmbd: change int data type to boolean · f4228b67
      Namjae Jeon 提交于
      Change data type of function that return only 0 or 1 to boolean.
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      f4228b67
    • M
      ksmbd: Fix multi-protocol negotiation · eebff916
      Marios Makassikis 提交于
      To negotiate either the SMB2 protocol or SMB protocol, a client must
      send a SMB_COM_NEGOTIATE message containing the list of dialects it
      supports, to which the server will respond with either a
      SMB_COM_NEGOTIATE or a SMB2_NEGOTIATE response.
      
      The current implementation responds with the highest common dialect,
      rather than looking explicitly for "SMB 2.???" and "SMB 2.002", as
      indicated in [MS-SMB2]:
      
        [MS-SMB2] 3.3.5.3.1:
          If the server does not implement the SMB 2.1 or 3.x dialect family,
          processing MUST continue as specified in 3.3.5.3.2.
      
          Otherwise, the server MUST scan the dialects provided for the dialect
          string "SMB 2.???". If the string is not present, continue to section
          3.3.5.3.2. If the string is present, the server MUST respond with an
          SMB2 NEGOTIATE Response as specified in 2.2.4.
      
        [MS-SMB2] 3.3.5.3.2:
          The server MUST scan the dialects provided for the dialect string "SMB
          2.002". If the string is present, the client understands SMB2, and the
          server MUST respond with an SMB2 NEGOTIATE Response.
      
      This is an issue if a client attempts to negotiate SMB3.1.1 using
      a SMB_COM_NEGOTIATE, as it will trigger the following NULL pointer
      dereference:
      
        8<--- cut here ---
        Unable to handle kernel NULL pointer dereference at virtual address 00000000
        pgd = 1917455e
        [00000000] *pgd=00000000
        Internal error: Oops: 17 [#1] ARM
        CPU: 0 PID: 60 Comm: kworker/0:1 Not tainted 5.4.60-00027-g0518c02b5c5b #35
        Hardware name: Marvell Kirkwood (Flattened Device Tree)
        Workqueue: ksmbd-io handle_ksmbd_work
        PC is at ksmbd_gen_preauth_integrity_hash+0x24/0x190
        LR is at smb3_preauth_hash_rsp+0x50/0xa0
        pc : [<802b7044>] lr : [<802d6ac0>] psr: 40000013
        sp : bf199ed8 ip : 00000000 fp : 80d1edb0
        r10: 80a3471b r9 : 8091af16 r8 : 80d70640
        r7 : 00000072 r6 : be95e198 r5 : ca000000 r4 : b97fee00
        r3 : 00000000 r2 : 00000002 r1 : b97fea00 r0 : b97fee00
        Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
        Control: 0005317f Table: 3e7f4000 DAC: 00000055
        Process kworker/0:1 (pid: 60, stack limit = 0x3dd1fdb4)
        Stack: (0xbf199ed8 to 0xbf19a000)
        9ec0: b97fee00 00000000
        9ee0: be95e198 00000072 80d70640 802d6ac0 b3da2680 b97fea00 424d53ff be95e140
        9f00: b97fee00 802bd7b0 bf10fa58 80128a78 00000000 000001c8 b6220000 bf0b7720
        9f20: be95e198 80d0c410 bf7e2a00 00000000 00000000 be95e19c 80d0c370 80123b90
        9f40: bf0b7720 be95e198 bf0b7720 bf0b7734 80d0c410 bf198000 80d0c424 80d116e0
        9f60: bf10fa58 801240c0 00000000 bf10fa40 bf1463a0 bf198000 bf0b7720 80123ed0
        9f80: bf077ee4 bf10fa58 00000000 80127f80 bf1463a0 80127e88 00000000 00000000
        9fa0: 00000000 00000000 00000000 801010d0 00000000 00000000 00000000 00000000
        9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
        [<802b7044>] (ksmbd_gen_preauth_integrity_hash) from [<802d6ac0>] (smb3_preauth_hash_rsp+0x50/0xa0)
        [<802d6ac0>] (smb3_preauth_hash_rsp) from [<802bd7b0>] (handle_ksmbd_work+0x348/0x3f8)
        [<802bd7b0>] (handle_ksmbd_work) from [<80123b90>] (process_one_work+0x160/0x200)
        [<80123b90>] (process_one_work) from [<801240c0>] (worker_thread+0x1f0/0x2e4)
        [<801240c0>] (worker_thread) from [<80127f80>] (kthread+0xf8/0x10c)
        [<80127f80>] (kthread) from [<801010d0>] (ret_from_fork+0x14/0x24)
        Exception stack(0xbf199fb0 to 0xbf199ff8)
        9fa0: 00000000 00000000 00000000 00000000
        9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        9fe0: 00000000 00000000 00000000 00000000 00000013 00000000
        Code: e1855803 e5d13003 e1855c03 e5903094 (e1d330b0)
        ---[ end trace 8d03be3ed09e5699 ]---
        Kernel panic - not syncing: Fatal exception
      
      smb3_preauth_hash_rsp() panics because conn->preauth_info is only allocated
      when processing a SMB2 NEGOTIATE request.
      
      Fix this by splitting the smb_protos array into two, each containing
      only SMB1 and SMB2 dialects respectively.
      
      While here, make ksmbd_negotiate_smb_dialect() static as it not
      called from anywhere else.
      Signed-off-by: NMarios Makassikis <mmakassikis@freebox.fr>
      Signed-off-by: NNamjae Jeon <namjae.jeon@samsung.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      eebff916
  13. 02 8月, 2021 1 次提交
  14. 27 7月, 2021 3 次提交