diff options
author | Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com> | 2024-09-03 17:16:24 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2024-09-04 16:51:11 +0200 |
commit | 6d14b18596ca69719cfe1af87dbf3c5e763d29b5 (patch) | |
tree | cf22d309ab23f495eba0c0d06b7e28478f4d5cd4 /fs/fuse | |
parent | 5b8ca5a54cb89ab07b0389f50e038e533cdfdd86 (diff) |
fuse: warn if fuse_access is called when idmapped mounts are allowed
It is not possible with the current fuse code, but let's protect ourselves
from regressions in the future.
Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/fuse')
-rw-r--r-- | fs/fuse/dir.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 6f289fa9cc62..99f9948bf68b 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1474,6 +1474,14 @@ static int fuse_access(struct inode *inode, int mask) BUG_ON(mask & MAY_NOT_BLOCK); + /* + * We should not send FUSE_ACCESS to the userspace + * when idmapped mounts are enabled as for this case + * we have fc->default_permissions = 1 and access + * permission checks are done on the kernel side. + */ + WARN_ON_ONCE(!(fm->sb->s_iflags & SB_I_NOIDMAP)); + if (fm->fc->no_access) return 0; |