qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "M. Mohan Kumar" <mohan@in.ibm.com>
To: qemu-devel@nongnu.org, "Daniel P. Berrange" <berrange@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Subject: Re: [Qemu-devel] [PATCH V12 00/15] virtio-9p: chroot environment for passthrough security model
Date: Tue, 13 Sep 2011 11:59:38 +0530	[thread overview]
Message-ID: <201109131159.39190.mohan@in.ibm.com> (raw)
In-Reply-To: <20110912162355.GP16275@redhat.com>


> I agree, regardless of libvirt's needs, p9fs needs to be secure for any
> non-root user using QEMU. As non-root I should be able todo
> 
>   $ qemu -virtfs $HOME/shared
> 
> and have strong confidence that symlink attacks can't be used by the
> guest to access other locations nuder $HOME.
> 
> > A virtfs feature that needs root therefore needs to be in a separate
> > process.  Either QEMU needs to fork or virtfs could use a separate
> > daemon binary.
> 
> One other idea I just had is 'fakechroot'. This is basically an LD_PRELOAD
> hack which wraps the C library's native chroot(), open() etc call to do
> chroot in userspace, thus avoiding a need for root privileges.
> 
> Either you could just invoke QEMU via fakechroot, enabling your code from
> these patches to be used as non-root. Or we could take the code from the
> fakechroot library and use that directly in the p9fs code to apply the
> path security checks
> 
With fakechroot is that I can still do following:
chroot("/etc/cups");
fd = open("../passwd", O_RDONLY);

It does not check access beyond the chroot path. Also in virtio-9p case, a 
modified guest kernel can send a symbolic link and that could resolve outside 
chroot path.

passthrough security model in virtio-9p needs root privilege not only for 
chroot() syscall but also to do chown and chmod on files created by the guest.

So IMHO fakechroot can't be used in this case.

      reply	other threads:[~2011-09-13  6:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-05 16:18 [Qemu-devel] [PATCH V12 00/15] virtio-9p: chroot environment for passthrough security model M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 01/15] Implement qemu_read_full M. Mohan Kumar
2011-09-05 17:57   ` malc
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 02/15] hw/9pfs: Enable CONFIG_THREAD if CONFIG_VIRTFS is enabled M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 03/15] hw/9pfs: Provide chroot worker side interfaces M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 04/15] hw/9pfs: qemu interfaces for chroot environment M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 05/15] hw/9pfs: Support for opening a file in " M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 06/15] hw/9pfs: Create support " M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 07/15] hw/9pfs: Creating special files " M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 08/15] hw/9pfs: Removing file or directory " M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 09/15] hw/9pfs: Rename " M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 10/15] hw/9pfs: Move file post creation changes to none security model M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 11/15] hw/9pfs: chmod in chroot environment M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 12/15] hw/9pfs: chown " M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 13/15] hw/9pfs: stat " M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 14/15] hw/9pfs: readlink " M. Mohan Kumar
2011-09-05 16:18 ` [Qemu-devel] [PATCH V12 15/15] hw/9pfs: Chroot environment for other functions M. Mohan Kumar
2011-09-06 14:48 ` [Qemu-devel] [PATCH V12 00/15] virtio-9p: chroot environment for passthrough security model Stefan Hajnoczi
2011-09-06 14:49   ` Stefan Hajnoczi
2011-09-12 14:15   ` M. Mohan Kumar
2011-09-12 16:23   ` Daniel P. Berrange
2011-09-13  6:29     ` M. Mohan Kumar [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=201109131159.39190.mohan@in.ibm.com \
    --to=mohan@in.ibm.com \
    --cc=berrange@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).