public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Mounting a 9P FS from inside a user NS ?
@ 2023-10-28 14:39 Edouard Klein
  0 siblings, 0 replies; only message in thread
From: Edouard Klein @ 2023-10-28 14:39 UTC (permalink / raw)
  To: linux-kernel

Dear Kernel Gurus,

I would like to mount 9P filesystems from inside user namespaces, in
order to replicate Plan 9's default per-process view of the filesystem,
with 9P as a glue to mount part of one process' fs in another process'
fs.

From what I understand, if I create a user- and mount- namespace, I
would be able to unprivilegially mount FSs in it. But only if those FS
have been deemed safe, blessed by the FS_USERNS_MOUNT flag.

For example, tmpfs is a safe FS, and I can do:
unshare --user --map-root-user --mount
mount -t tmpfs tmpfs mnt/mnt1/

and it works.

However, if I do:
unshare --user --map-root-user --mount
mount -t 9p -o trans=unix /run/9p/srv4 mnt/mnt1

I get  mount: /home/edouard/mnt/mnt1: permission denied.

My question is: Are there currently any plans to make v9fs a
FS_USERNS_MOUNT-flagged, safe filesystem ?

If not, is it because of a fundamental design flaw somewhere that make
v9fs less safe than e.g. FUSE, which AFAIK, is deemed safe ?

Or is it because nobody ever got around to it ?

This 2018 thread:
https://lore.kernel.org/all/39b08c53-3449-3164-c1b1-44ac587dd4ea@metux.net/T/
ended with
> plan9fs would also be a candidate for that kind of treatment [being
> allowed for unprivileged mounts] if it had a maintainer.
>

Is this still true ? I did not know v9fs was unmaintained.

How big of a change would making v9fs FS_USERNS_MOUNT-flagged be ? Would
anybody here be open to guide an effort made (by me or anybody else) to
implement this change ?


Last question: I think I can temporarily get by by writing a FUSE
wrapper for 9P2000.L (the current wrappers, 9pfs and plan9port's 9pfuse
only speak 9P2000). Is there an easier temporary solution ?

Thank you for your time and hard work around the kernel.

Cheers,

Edouard.

P.S. Please keep me in CC of the replies if you can.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-28 15:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-28 14:39 Mounting a 9P FS from inside a user NS ? Edouard Klein

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