1. 04 9月, 2021 3 次提交
    • 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
  2. 21 8月, 2021 1 次提交
  3. 13 8月, 2021 4 次提交
  4. 02 8月, 2021 1 次提交
  5. 27 7月, 2021 5 次提交
  6. 22 7月, 2021 2 次提交
  7. 19 7月, 2021 2 次提交
  8. 13 7月, 2021 3 次提交
  9. 10 7月, 2021 5 次提交
  10. 09 7月, 2021 1 次提交
  11. 08 7月, 2021 2 次提交
  12. 06 7月, 2021 1 次提交
  13. 05 7月, 2021 1 次提交
  14. 02 7月, 2021 2 次提交
  15. 29 6月, 2021 7 次提交