From: "Michael S. Tsirkin" <mst@redhat.com>
To: Greg Kurz <groug@kaod.org>
Cc: Peter Maydell <peter.maydell@linaro.org>,
QEMU Developers <qemu-devel@nongnu.org>,
Felix Wilhelm <fwilhelm@ernw.de>, P J P <ppandit@redhat.com>,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH] 9pfs: disallow / in path components
Date: Wed, 24 Aug 2016 21:23:04 +0300 [thread overview]
Message-ID: <20160824212249-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20160824184145.12b37f9d@bahia.lan>
On Wed, Aug 24, 2016 at 06:41:45PM +0200, Greg Kurz wrote:
> On Wed, 24 Aug 2016 18:46:10 +0300
> "Michael S. Tsirkin" <mst@redhat.com> wrote:
>
> > On Wed, Aug 24, 2016 at 04:00:24PM +0100, Peter Maydell wrote:
> > > On 24 August 2016 at 15:29, Greg Kurz <groug@kaod.org> wrote:
> > > > At various places in 9pfs, full paths are created by concatenating a guest
> > > > originated string to the export path. A malicious guest could forge a
> > > > relative path and access files outside the export path.
> > > >
> > > > A tentative fix was sent recently by Prasad J Pandit, but it was only
> > > > focused on the local backend and did not get a positive review. This patch
> > > > tries to address the issue more globally, based on the official 9P spec.
> > > >
> > > > The walk request described in the 9P spec [1] clearly shows that the client
> > > > is supposed to send individual path components: the official linux client
> > > > never sends portions of path containing the / character for example.
> > > >
> > > > Moreover, the 9P spec [2] also states that a system can decide to restrict
> > > > the set of supported characters used in path components, with an explicit
> > > > mention "to remove slashes from name components".
> > > >
> > > > This patch introduces a new name_has_illegal_characters() helper that looks
> > > > for such unwanted characters in strings sent by the client. Since 9pfs is
> > > > only supported on linux hosts, only the / character is checked at the
> > > > moment. When support for other hosts (AKA. win32) is added, other chars
> > > > may need to be blacklisted as well.
> > >
> > > Do we also need ".." and "." to be illegal names (for at least most
> > > operations)?
> > >
> > > thanks
> > > -- PMM
> >
> > I agree, and I think this implies name_is_legal would be a better function name.
> >
>
> No I think this is a different issue that calls for a followup patch (see my
> other mail).
OK, that's fine.
--
MST
next prev parent reply other threads:[~2016-08-24 18:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-24 14:29 [Qemu-devel] [PATCH] 9pfs: disallow / in path components Greg Kurz
2016-08-24 15:00 ` Peter Maydell
2016-08-24 15:46 ` Michael S. Tsirkin
2016-08-24 16:41 ` Greg Kurz
2016-08-24 18:23 ` Michael S. Tsirkin [this message]
2016-08-24 16:40 ` Greg Kurz
2016-08-24 19:23 ` Peter Maydell
2016-08-25 14:24 ` Greg Kurz
2016-08-24 18:23 ` Michael S. Tsirkin
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=20160824212249-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=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.