From: "Darrick J. Wong" <djwong@kernel.org>
To: Skye Soss <skye@soss.website>
Cc: fuse-devel <fuse-devel@lists.linux.dev>
Subject: Re: mount_service: possible implementation changes
Date: Wed, 12 Aug 2026 12:02:07 -0700 [thread overview]
Message-ID: <20260812190207.GX7398@frogsfrogsfrogs> (raw)
In-Reply-To: <19fe7563e31.3e54918e70503.7575531443351235941@soss.website>
On Sun, Aug 09, 2026 at 11:23:36AM -0500, Skye Soss wrote:
> > > > Ie. The fuservicemount binary would be a non-setuid binary, and simply
> > > > communicate with a socket in /run that is backed by a privileged
> > > > socket-activated service. Upon activation, the service would use the
> > > > peer credentials to enforce limits such as `mount_max`, and configure
> > > > `/dev/fuse`. Finally, it would spawn the sandboxed systemd unit to run
> > > > the filesystem, using `--scope` to transfer the file descriptors to
> > > > the new process, or using socket activation with a socket file that
> > > > only root can read and write to.
>
> > > I am, of course, curious to read any patches you have implementing this.
> >
> > Thanks for the interest! I'll try to write something up next week.
>
> I've been working on a proof-of-concept on-and-off for the past month, which you can
> find at https://github.com/Skyb0rg007/defused.
> I'd recommend just looking at the README and doc/protocol.md for details.
>
> From my attempt at this redesign, I now think that this "client-server" approach is
> probably *not* a good idea to merge into libfuse, and that its best to keep as a
> separate project.
> This is primarily because there aren't good ways to implement the filesystem access
> check that a setuid program has access to: installing defused allows programs
> to mount over directories that an AppArmor rule would have otherwise disallowed.
Er, why is that? Does AppArmor not enforce the same rules between an
unprivileged process trying a direct mount() vs. a privileged process
that has entered another process' mount namespace to call mount()?
Can you setns more namespaces (e.g. enter the user namespace as well and
then setuid to the socket client process' credentials?)
> Another is security: the system service calls `setns()` on the client's mount namespace
> with root privileges, which can very easily become a security issue if libc lazily
> loads any shared libraries. I solve this by installing an extremely strict seccomp
> filter, but this is not something libfuse should have to worry about.
Huh. So the defused daemon forks a child which adds its own seccomp
filter, and only then does it enter the socket client's mount namespace
to attach the mount?
Clever. :)
--D
prev parent reply other threads:[~2026-08-12 19:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-06 22:26 mount_service: possible implementation changes Skye Soss
2026-07-07 5:52 ` Darrick J. Wong
2026-07-09 16:57 ` Skye Soss
2026-08-09 16:23 ` Skye Soss
2026-08-12 19:02 ` Darrick J. Wong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260812190207.GX7398@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=fuse-devel@lists.linux.dev \
--cc=skye@soss.website \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.