]> git.baikalelectronics.ru Git - kernel.git/commit
ksmbd: fix translation in acl entries
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 23 Aug 2021 15:13:51 +0000 (17:13 +0200)
committerSteve French <stfrench@microsoft.com>
Sat, 4 Sep 2021 04:29:44 +0000 (23:29 -0500)
commit34d4c52ee854f1aa1d4947670c4ba527da825709
tree0ab0d16256c296532a14fa9ac98328c13939faf3
parent0dfb8dc5080d26f01a3d39b2ddd3bffdee7f66b0
ksmbd: fix translation in acl entries

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: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/smbacl.c
fs/ksmbd/smbacl.h
fs/ksmbd/vfs.c