diff options
author | Christian Brauner <christian.brauner@ubuntu.com> | 2021-08-23 17:13:47 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2021-09-03 23:29:44 -0500 |
commit | da1e7ada5b62859b3a9d236a44035ae9d8f3f7e1 (patch) | |
tree | 8cd6144fa2ad54faf4ad74ba8fac292999577e25 /init | |
parent | 9c849ce86e0fa93a218614eac562ace44053d7ce (diff) | |
download | linux-da1e7ada5b62859b3a9d236a44035ae9d8f3f7e1.tar.gz linux-da1e7ada5b62859b3a9d236a44035ae9d8f3f7e1.tar.bz2 linux-da1e7ada5b62859b3a9d236a44035ae9d8f3f7e1.zip |
ksmbd: fix lookup on idmapped mounts
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: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions