All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Greg Kurz <groug@kaod.org>, P J P <ppandit@redhat.com>,
	Qemu Developers <qemu-devel@nongnu.org>,
	Prasad J Pandit <pjp@fedoraproject.org>,
	Felix Wilhelm <fwilhelm@ernw.de>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] 9pfs: add check for relative path
Date: Mon, 22 Aug 2016 17:14:28 +0300	[thread overview]
Message-ID: <20160822170700-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAFEAcA8V=_DHh4tJn6Nbt0WPKv1+T2eNxdZD1ZJtV863tq0roA@mail.gmail.com>

On Fri, Aug 19, 2016 at 06:03:29PM +0100, Peter Maydell wrote:
> On 19 August 2016 at 17:37, Greg Kurz <groug@kaod.org> wrote:
> > Peter Maydell <peter.maydell@linaro.org> wrote:
> >> If (1) is true and "only single path component" is a protocol
> >> requirement then probably we should be enforcing this at a
> >> higher layer than in 9p-local.c, ie in hw/9pfs/cofs.c.
> 
> > As we discussed on IRC, the / character isn't invalid per-se. It raises
> > issues with the local backend on a linux host but does not do harm with
> > other backends.
> >
> > The proxy backend also accesses the linux filesystem but since it
> > chroots to the export path, it does not hit the path traversal issue.
> 
> The proxy backend is not actually going to do the right thing with
> a component name containing a '/' though (which would be to really
> treat it as a filename or whatever with a '/', not to mis-interpret
> it as a combined directory-and-filename. For instance opening "foo/bar"
> ought to open a file named "foo/bar", not a file bar in directory foo,
> if we're going to accept it.) It might not be a security hole, but
> it still doesn't actually support '/' in filenames.
> 
> The handle backend also assumes '/' isn't in filenames.
> 
> 'synth' might be able to handle '/' I guess, but I'd want to
> audit the code before I put any weight on that assertion.
> 
> I don't really see the point in allowing a theoretical
> /-in-names-aware backend to interact with an equally theoretical
> /-in-names-aware frontend: nobody in practice is going to
> use this. The downside of support in the middle-layer code for
> this theoretical case is that we make it harder to write correct
> backends and easy to accidentally allow security holes.

FWIW I agree.

> I'd prefer it if we made the check in the middle layer and
> explicitly said "all QEMU 9p servers insist that '/' is not a
> valid character in filenames, and backend code can assume that
> the middle layer has validated this".
> 
> thanks
> -- PMM

  parent reply	other threads:[~2016-08-22 14:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-11  5:13 [Qemu-devel] [PATCH] 9pfs: add check for relative path P J P
2016-08-11  6:17 ` no-reply
2016-08-11  6:27   ` Fam Zheng
2016-08-18 16:55     ` Greg Kurz
2016-08-11  6:31 ` Aneesh Kumar K.V
2016-08-18 15:19   ` Greg Kurz
2016-08-18 17:06 ` Greg Kurz
2016-08-19 14:55 ` Peter Maydell
2016-08-19 15:14   ` Peter Maydell
2016-08-19 16:37     ` Greg Kurz
2016-08-19 17:03       ` Peter Maydell
2016-08-19 17:30         ` Greg Kurz
2016-08-22  9:23           ` Peter Maydell
2016-08-22 10:07             ` P J P
2016-08-22 15:02             ` Michael S. Tsirkin
2016-08-22 15:07               ` Peter Maydell
2016-08-22 14:14         ` Michael S. Tsirkin [this message]
2016-08-19 16:24   ` Greg Kurz

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=20160822170700-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=fwilhelm@ernw.de \
    --cc=groug@kaod.org \
    --cc=peter.maydell@linaro.org \
    --cc=pjp@fedoraproject.org \
    --cc=ppandit@redhat.com \
    --cc=qemu-devel@nongnu.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 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.