[PATCH RFC 38/41] fuse: refuse files on pseudo filesystems as passthrough backing files
Christian Brauner
brauner at kernel.org
Tue Nov 10 01:14:54 PST 2026
The fuse server can register any regular file as a backing file. procfs
and binfmt_misc files are already refused by the stacking depth check as
both set s_stack_depth to FILESYSTEM_MAX_STACK_DEPTH. sysfs and the
other pseudo filesystems aren't. Reads and writes of the fuse file would
then be done on the pseudo file with the fuse server's credentials.
Refuse files on pseudo filesystems just like loop does.
Signed-off-by: Christian Brauner (Amutable) <brauner at kernel.org>
---
fs/fuse/backing.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/fuse/backing.c b/fs/fuse/backing.c
index 8c21a8a74efb..4e4fb810ddaa 100644
--- a/fs/fuse/backing.c
+++ b/fs/fuse/backing.c
@@ -147,6 +147,9 @@ static int fuse_backing_open_file(struct fuse_conn *fc, struct fuse_backing *fb,
if (inode->i_sb->s_stack_depth >= fc->max_stack_depth)
return -ELOOP;
+ if (file_is_pseudo(file))
+ return -EINVAL;
+
fb->type = FUSE_BACKING_PATH;
fb->path = file->f_path;
path_get(&fb->path);
--
2.53.0
More information about the Linux-nvme
mailing list