public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Edouard Klein <edou@rdklein.fr>
To: linux-kernel@vger.kernel.org
Subject: Mounting a 9P FS from inside a user NS ?
Date: Sat, 28 Oct 2023 16:39:35 +0200	[thread overview]
Message-ID: <87zg02bxhd.fsf@rdklein.fr> (raw)

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.

                 reply	other threads:[~2023-10-28 15:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87zg02bxhd.fsf@rdklein.fr \
    --to=edou@rdklein.fr \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox