linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fuse: enable unprivileged mounts for fuseblk
@ 2022-10-16 17:00 Simon Thoby
  2022-11-07 13:29 ` Miklos Szeredi
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Thoby @ 2022-10-16 17:00 UTC (permalink / raw)
  To: Miklos Szeredi
  Cc: Simon Thoby, CONZELMANN Francois, Eric W . Biederman,
	linux-fsdevel, linux-kernel

Commit 4ad769f3c346ec3d458e255548dec26ca5284cf6 ("fuse: Allow fully
unprivileged mounts") enabled mounting filesystems with the 'fuse' type for
any user with CAP_SYS_ADMIN inside their respective user namespace, but did
not do so for the 'fuseblk' filesystem type.

Some FUSE filesystems implementations - like ntfs-3g - prefer using
'fuseblk' over 'fuse', which imply unprivileged users could not use these
tools - in their "out-of-the-box" configuration, as these tools can always
be patched to use the 'fuse' filesystem type to circumvent the problem.

Enable unprivileged mounts for the 'fuseblk' type, thus uniformizing the
behavior of the two FUSE filesystem types.

Signed-off-by: Simon Thoby <work.viveris@nightmared.fr>
---
 fs/fuse/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 6b3beda16c1b..d17f87531dc8 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1839,7 +1839,7 @@ static struct file_system_type fuseblk_fs_type = {
 	.init_fs_context = fuse_init_fs_context,
 	.parameters	= fuse_fs_parameters,
 	.kill_sb	= fuse_kill_sb_blk,
-	.fs_flags	= FS_REQUIRES_DEV | FS_HAS_SUBTYPE,
+	.fs_flags	= FS_REQUIRES_DEV | FS_HAS_SUBTYPE | FS_USERNS_MOUNT,
 };
 MODULE_ALIAS_FS("fuseblk");
 

base-commit: 472c7791cc2b48010af3ce61ce76edbaa26500d2
-- 
2.38.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fuse: enable unprivileged mounts for fuseblk
  2022-10-16 17:00 [PATCH] fuse: enable unprivileged mounts for fuseblk Simon Thoby
@ 2022-11-07 13:29 ` Miklos Szeredi
  0 siblings, 0 replies; 2+ messages in thread
From: Miklos Szeredi @ 2022-11-07 13:29 UTC (permalink / raw)
  To: Simon Thoby
  Cc: CONZELMANN Francois, Eric W . Biederman, linux-fsdevel, linux-kernel

On Sun, 16 Oct 2022 at 19:00, Simon Thoby <work.viveris@nightmared.fr> wrote:
>
> Commit 4ad769f3c346ec3d458e255548dec26ca5284cf6 ("fuse: Allow fully
> unprivileged mounts") enabled mounting filesystems with the 'fuse' type for
> any user with CAP_SYS_ADMIN inside their respective user namespace, but did
> not do so for the 'fuseblk' filesystem type.
>
> Some FUSE filesystems implementations - like ntfs-3g - prefer using
> 'fuseblk' over 'fuse', which imply unprivileged users could not use these
> tools - in their "out-of-the-box" configuration, as these tools can always
> be patched to use the 'fuse' filesystem type to circumvent the problem.
>
> Enable unprivileged mounts for the 'fuseblk' type, thus uniformizing the
> behavior of the two FUSE filesystem types.
>
> Signed-off-by: Simon Thoby <work.viveris@nightmared.fr>

NAK in this form.

Please look at all the places where there's a difference between the
fuse and the fuseblk behavior and give proof that they won't result in
a security issue in case fuseblk is mounted unprivileged.

As a possibly much better alternative, try modifying the ntfs-3g code
to be able to work using the "fuse" fs type as well.

Thanks,
Miklos

fuseblk enables synchronouse RELEASE and DESTROY requests that are
unsuitable for unprivileged operation.


Thanks,
Miklos

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-07 13:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-16 17:00 [PATCH] fuse: enable unprivileged mounts for fuseblk Simon Thoby
2022-11-07 13:29 ` Miklos Szeredi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).