Skip to content

Commit 6d14b18

Browse files
mihalicynMiklos Szeredi
authored andcommitted
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>
1 parent 5b8ca5a commit 6d14b18

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fs/fuse/dir.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,14 @@ static int fuse_access(struct inode *inode, int mask)
14741474

14751475
BUG_ON(mask & MAY_NOT_BLOCK);
14761476

1477+
/*
1478+
* We should not send FUSE_ACCESS to the userspace
1479+
* when idmapped mounts are enabled as for this case
1480+
* we have fc->default_permissions = 1 and access
1481+
* permission checks are done on the kernel side.
1482+
*/
1483+
WARN_ON_ONCE(!(fm->sb->s_iflags & SB_I_NOIDMAP));
1484+
14771485
if (fm->fc->no_access)
14781486
return 0;
14791487

0 commit comments

Comments
 (0)