mbox series

[00/11] ksmbd: various fixes

Message ID 20210823151357.471691-1-brauner@kernel.org (mailing list archive)
Headers show
Series ksmbd: various fixes | expand

Message

Christian Brauner Aug. 23, 2021, 3:13 p.m. UTC
From: Christian Brauner <christian.brauner@ubuntu.com>

Hey everyone,

I took the time to look at ksmbd last week and today. I performed
various tests, read a bunch of code and discovered a few bugs that I
addressed in this series. Most of them simply deal with the translation
of ownership between samba ids and unix ids.

The server client model makes it a bit harder to reason about things but
in essence ksmbd behaves like a very simple shim sitting on top of the
underlying filesystem and thus bares some _vague_ resemblance to
overlayfs and other overlay-style filesystems. The crucial thing is that
ksmbd calls into the lower filesystem to create and manage filesystem
objects. This is inherently a tricky thing to get right as it
essentially involves two-level thinking all of the time. The easiest
conceptual model I came up with for me is that ksmbd is similar to a
userspace process that calls into the filesystem. With this model in
mind it becomes a lot clearer how ownership needs to be managed. I tried
to reflect that thinking in the commit message explaining why what
happens.

Thanks!
Christian

Christian Brauner (11):
  ksmbd: fix lookup on idmapped mounts
  ksmbd: fix translation in smb2_populate_readdir_entry()
  ksmbd: fix translation in create_posix_rsp_buf()
  smb2pdu: fix translation in ksmbd_acls_fattr()
  ksmbd: fix translation in acl entries
  ksmbd: fix subauth 0 handling in sid_to_id()
  ksmbd: fix translation in sid_to_id()
  ndr: fix translation in ndr_encode_posix_acl()
  ksmbd: ensure error is surfaced in set_file_basic_info()
  ksmbd: remove setattr preparations in set_file_basic_info()
  ksmbd: defer notify_change() call

 fs/ksmbd/ndr.c        |  4 +--
 fs/ksmbd/oplock.c     |  6 ++--
 fs/ksmbd/smb2pdu.c    | 43 +++++++++++++--------------
 fs/ksmbd/smb_common.c |  4 +--
 fs/ksmbd/smb_common.h |  1 -
 fs/ksmbd/smbacl.c     | 69 +++++++++++++++++++++++++++----------------
 fs/ksmbd/smbacl.h     | 25 ++++++++++++++++
 fs/ksmbd/vfs.c        | 47 ++++++++++++++++-------------
 fs/ksmbd/vfs.h        |  3 +-
 9 files changed, 125 insertions(+), 77 deletions(-)


base-commit: 0bffa153a2f46dcbced4a48167e91522d8aabe58