1. 12 11月, 2021 7 次提交
  2. 07 11月, 2021 2 次提交
  3. 20 10月, 2021 3 次提交
  4. 15 10月, 2021 1 次提交
  5. 14 10月, 2021 4 次提交
  6. 07 10月, 2021 3 次提交
  7. 30 9月, 2021 5 次提交
  8. 27 9月, 2021 1 次提交
  9. 25 9月, 2021 1 次提交
  10. 23 9月, 2021 2 次提交
  11. 22 9月, 2021 1 次提交
  12. 18 9月, 2021 2 次提交
  13. 09 9月, 2021 1 次提交
    • N
      ksmbd: fix read of uninitialized variable ret in set_file_basic_info · 4ffd5264
      Namjae Jeon 提交于
      Addresses-Coverity reported Uninitialized variables warninig :
      
      /fs/ksmbd/smb2pdu.c: 5525 in set_file_basic_info()
      5519                    if (!rc) {
      5520                            inode->i_ctime = ctime;
      5521                            mark_inode_dirty(inode);
      5522                    }
      5523                    inode_unlock(inode);
      5524            }
      >>>     CID 1506805:  Uninitialized variables  (UNINIT)
      >>>     Using uninitialized value "rc".
      5525            return rc;
      5526     }
      5527
      5528     static int set_file_allocation_info(struct ksmbd_work *work,
      5529                                 struct ksmbd_file *fp, char *buf)
      5530     {
      
      Addresses-Coverity: ("Uninitialized variable")
      Signed-off-by: NNamjae Jeon <linkinjeon@kernel.org>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      4ffd5264
  14. 04 9月, 2021 6 次提交
    • 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: 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
      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 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
  15. 21 8月, 2021 1 次提交