public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v3] libfuse: run fuse servers as a contained service
@ 2026-03-27  1:24 Darrick J. Wong
  2026-03-27  1:25 ` [PATCH 01/17] Refactor mount code / move common functions to mount_util.c Darrick J. Wong
                   ` (16 more replies)
  0 siblings, 17 replies; 28+ messages in thread
From: Darrick J. Wong @ 2026-03-27  1:24 UTC (permalink / raw)
  To: djwong, bschubert; +Cc: linux-fsdevel, bernd, miklos, neal, joannelkoong

Hi all,

This patchset defines the necessary communication protocols and library
code so that users can mount fuse servers that run in unprivileged
systemd service containers.  That in turn allows unprivileged untrusted
mounts, because the worst that can happen is that a malicious image
crashes the fuse server and the mount dies, instead of corrupting the
kernel's memory.

v3: refactor the sample code to reduce duplication; fix all the
    checkpatch complaints; examples actually build standalone;
    fuservicemount handles utab now; cleaned up meson feature detection;
    handle MS_ flags that don't translate to MOUNT_ATTR_*
v2: cleaned up error code handling and logging; add some example fuse
    service; fuservicemount3 can now be a setuid program to allow
    unprivileged userspace to fire up a contained filesystem driver.
    This could be opening Pandora's box...
v1: detach from fuse-iomap series

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

With a bit of luck, this should all go splendidly.
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=fuse-service-container
---
Commits in this patchset:
 * Refactor mount code / move common functions to mount_util.c
 * mount_service: add systemd/inetd socket service mounting helper
 * mount_service: create high level fuse helpers
 * mount_service: use the new mount api for the mount service
 * mount_service: update mtab after a successful mount
 * util: hoist the fuse.conf parsing code
 * util: fix checkpatch complaints in fuser_conf.[ch]
 * mount_service: read fuse.conf to enable allow_other for unprivileged mounts
 * util: hoist the other non-root user limits
 * util: fix more checkpatch complaints in fuser_conf.[ch]
 * mount_service: use over the other non-root user checks
 * mount.fuse3: integrate systemd service startup
 * mount_service: allow installation as a setuid program
 * example/service_ll: create a sample systemd service fuse server
 * example/service: create a sample systemd service for a high-level fuse server
 * example/hello_ll: port to single-file common code
 * nullfs: support fuse systemd service mode
---
 example/single_file.h                       |  173 +++
 include/fuse.h                              |   33 +
 include/fuse_service.h                      |  215 ++++
 include/fuse_service_priv.h                 |  128 ++
 lib/mount_common_i.h                        |   22 
 lib/mount_util.h                            |    8 
 lib/util.h                                  |   35 +
 util/fuser_conf.h                           |   50 +
 util/mount_service.h                        |   40 +
 .github/workflows/abicheck.yml              |    2 
 .github/workflows/abicheck_prev_release.yml |    2 
 .github/workflows/pr-ci.yml                 |    2 
 README.md                                   |    3 
 doc/fuservicemount3.8                       |   32 +
 doc/meson.build                             |    3 
 example/hello_ll.c                          |  128 --
 example/meson.build                         |   28 
 example/null.c                              |   33 +
 example/nullfile.socket.in                  |   15 
 example/nullfile@.service                   |  102 ++
 example/service_hl.c                        |  215 ++++
 example/service_hl.socket.in                |   15 
 example/service_hl@.service                 |  102 ++
 example/service_ll.c                        |  304 +++++
 example/service_ll.socket.in                |   15 
 example/service_ll@.service                 |  102 ++
 example/single_file.c                       |  724 +++++++++++++
 include/meson.build                         |    4 
 lib/fuse_service.c                          | 1004 ++++++++++++++++++
 lib/fuse_service_stub.c                     |   96 ++
 lib/fuse_versionscript                      |   17 
 lib/helper.c                                |  110 ++
 lib/meson.build                             |   16 
 lib/mount.c                                 |   72 +
 lib/mount_util.c                            |    9 
 meson.build                                 |   59 +
 meson_options.txt                           |    6 
 test/ci-build.sh                            |    7 
 util/fuser_conf.c                           |  369 +++++++
 util/fusermount.c                           |  325 ------
 util/fuservicemount.c                       |   66 +
 util/install_helper.sh                      |    6 
 util/meson.build                            |   22 
 util/mount.fuse.c                           |   58 +
 util/mount_service.c                        | 1531 +++++++++++++++++++++++++++
 45 files changed, 5817 insertions(+), 491 deletions(-)
 create mode 100644 example/single_file.h
 create mode 100644 include/fuse_service.h
 create mode 100644 include/fuse_service_priv.h
 create mode 100644 lib/mount_common_i.h
 create mode 100644 util/fuser_conf.h
 create mode 100644 util/mount_service.h
 create mode 100644 doc/fuservicemount3.8
 create mode 100644 example/nullfile.socket.in
 create mode 100644 example/nullfile@.service
 create mode 100644 example/service_hl.c
 create mode 100644 example/service_hl.socket.in
 create mode 100644 example/service_hl@.service
 create mode 100644 example/service_ll.c
 create mode 100644 example/service_ll.socket.in
 create mode 100644 example/service_ll@.service
 create mode 100644 example/single_file.c
 create mode 100644 lib/fuse_service.c
 create mode 100644 lib/fuse_service_stub.c
 create mode 100644 util/fuser_conf.c
 create mode 100644 util/fuservicemount.c
 create mode 100644 util/mount_service.c


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

end of thread, other threads:[~2026-03-30 21:47 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-27  1:24 [PATCHSET v3] libfuse: run fuse servers as a contained service Darrick J. Wong
2026-03-27  1:25 ` [PATCH 01/17] Refactor mount code / move common functions to mount_util.c Darrick J. Wong
2026-03-27  1:25 ` [PATCH 02/17] mount_service: add systemd/inetd socket service mounting helper Darrick J. Wong
2026-03-30 20:44   ` Bernd Schubert
2026-03-30 21:37     ` Darrick J. Wong
2026-03-27  1:25 ` [PATCH 03/17] mount_service: create high level fuse helpers Darrick J. Wong
2026-03-30 19:37   ` Bernd Schubert
2026-03-30 20:30     ` Darrick J. Wong
2026-03-30 20:51       ` Bernd Schubert
2026-03-30 21:09         ` Darrick J. Wong
2026-03-27  1:25 ` [PATCH 04/17] mount_service: use the new mount api for the mount service Darrick J. Wong
2026-03-30 21:06   ` Bernd Schubert
2026-03-30 21:18     ` Darrick J. Wong
2026-03-30 21:40       ` Bernd Schubert
2026-03-30 21:47         ` Darrick J. Wong
2026-03-27  1:26 ` [PATCH 05/17] mount_service: update mtab after a successful mount Darrick J. Wong
2026-03-27  1:26 ` [PATCH 06/17] util: hoist the fuse.conf parsing code Darrick J. Wong
2026-03-27  1:26 ` [PATCH 07/17] util: fix checkpatch complaints in fuser_conf.[ch] Darrick J. Wong
2026-03-27  1:26 ` [PATCH 08/17] mount_service: read fuse.conf to enable allow_other for unprivileged mounts Darrick J. Wong
2026-03-27  1:27 ` [PATCH 09/17] util: hoist the other non-root user limits Darrick J. Wong
2026-03-27  1:27 ` [PATCH 10/17] util: fix more checkpatch complaints in fuser_conf.[ch] Darrick J. Wong
2026-03-27  1:27 ` [PATCH 11/17] mount_service: use over the other non-root user checks Darrick J. Wong
2026-03-27  1:27 ` [PATCH 12/17] mount.fuse3: integrate systemd service startup Darrick J. Wong
2026-03-27  1:28 ` [PATCH 13/17] mount_service: allow installation as a setuid program Darrick J. Wong
2026-03-27  1:28 ` [PATCH 14/17] example/service_ll: create a sample systemd service fuse server Darrick J. Wong
2026-03-27  1:28 ` [PATCH 15/17] example/service: create a sample systemd service for a high-level " Darrick J. Wong
2026-03-27  1:28 ` [PATCH 16/17] example/hello_ll: port to single-file common code Darrick J. Wong
2026-03-27  1:29 ` [PATCH 17/17] nullfs: support fuse systemd service mode Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox