public inbox for virtio-fs@lists.linux.dev
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Colin Walters <walters@verbum.org>
Cc: Sergio Lopez <slp@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	virtio-fs-list <virtio-fs@redhat.com>,
	qemu-devel@nongnu.org, German Maglione <gmaglione@redhat.com>
Subject: Re: [Virtio-fs] virtiofsd: Any reason why there's not an "openat2" sandbox mode?
Date: Thu, 29 Sep 2022 13:03:45 -0400	[thread overview]
Message-ID: <YzXP8XhCG5ta2Dvv@redhat.com> (raw)
In-Reply-To: <b1cf0d02-cc45-4f5c-bfef-fda3e750bef3@app.fastmail.com>

On Thu, Sep 29, 2022 at 11:47:32AM -0400, Colin Walters wrote:
> 
> 
> On Thu, Sep 29, 2022, at 10:10 AM, Vivek Goyal wrote:
> 
> > What's your use case. How do you plan to use virtiofs.
> 
> At the current time, the Kubernetes that we run does not support user namespaces.  We want to do the production builds of our operating system (Fedora CoreOS and RHEL CoreOS) today inside an *unprivileged* Kubernetes pod (actually in OpenShift using anyuid, i.e. random unprivileged uid too), just with /dev/kvm exposed from the host (which is safe).  Operating system builds *and* tests in qemu are just another workload that can be shared with other tenants.
> 
> qemu works fine in this model, as does 9p.  It's just the virtiofs isolation requires privileges to be used today.

[ cc German ]

Hi Colin,

So rust version of virtiofsd, already supports running unprivileged
(inside a user namespace).

https://gitlab.com/virtio-fs/virtiofsd/-/blob/main/README.md#running-as-non-privileged-user

host$ podman unshare -- virtiofsd --socket-path=/tmp/vfsd.sock --shared-dir /mnt \
        --announce-submounts --sandbox chroot &

I think only privileged operation it needs is assigning a range of
subuid/subgid to the uid you are using on host.

I think that should be usable for you as of now.

Having said that, openat2() and landlock are interesting improvements,
especially when somebody does not want to use user namespaces. Without
user namespaces, one will not be able to do arbitrary swithing of uid/gid.
IOW, inside guest, you will be limited to one uid/gid.

I am hoping German or somebody else can have a look openat2() and landlock
improvements in near future.

I am assuming you are fine with using user namespaces on host. And by
assigning subuid/subgid range, it will allow you arbitrary swithching
of uid/gid inside guest.

Can you give rust virtiofsd (unprivileged) a try.

Thanks
Vivek

  reply	other threads:[~2022-09-29 17:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4362261a-c762-4666-84e2-03c9daa6c4d9@www.fastmail.com>
2022-09-27 16:37 ` [Virtio-fs] virtiofsd: Any reason why there's not an "openat2" sandbox mode? Vivek Goyal
2022-09-27 16:57   ` Vivek Goyal
2022-09-27 17:27     ` German Maglione
2022-09-27 17:51       ` Colin Walters
2022-09-27 20:14         ` Stefan Hajnoczi
2022-09-28  8:33           ` Sergio Lopez
2022-09-28 19:28             ` Vivek Goyal
2022-09-29 14:04               ` Colin Walters
2022-09-29 14:10                 ` Vivek Goyal
2022-09-29 15:47                   ` Colin Walters
2022-09-29 17:03                     ` Vivek Goyal [this message]
2022-09-30  8:13                       ` German Maglione
2022-10-03 22:51                       ` Colin Walters
2022-10-05 21:29                         ` Vivek Goyal
2022-09-28 19:26       ` Vivek Goyal

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=YzXP8XhCG5ta2Dvv@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=gmaglione@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=slp@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtio-fs@redhat.com \
    --cc=walters@verbum.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