All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: Li Qiang <liq3ea@gmail.com>
Cc: Eric Blake <eblake@redhat.com>, Li Qiang <liqiang6-s@360.cn>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/2] 9pfs: fix information leak in xattr read
Date: Thu, 13 Oct 2016 10:08:35 +0200	[thread overview]
Message-ID: <20161013100835.0fba59a2@bahia> (raw)
In-Reply-To: <CAKXe6SK7Hr5PGqOU--vDJhTqjnkbweFXJxNS7Zzdc5DjYdzcSg@mail.gmail.com>

On Thu, 13 Oct 2016 11:30:08 +0800
Li Qiang <liq3ea@gmail.com> wrote:

> Yes, I think the limit to apply to xattr size in 9pfs is the same as the
> Linux xattr size limit, I will try to find this limit.
> 

/usr/include/linux/limits.h:#define XATTR_SIZE_MAX 65536        /* size of an extended attribute value (64k) */

> Thanks.
> 
> On 2016-10-13 4:49 GMT+08:00 Eric Blake <eblake@redhat.com> wrote:
> 
> > On 10/12/2016 08:23 AM, Greg Kurz wrote:
> > >
> > > But in fact, I'm afraid we have a more serious problem here... size
> > > comes from the guest and could cause g_malloc() to abort if QEMU has
> > > reached some RLIMIT... we need to call g_try_malloc0() and return
> > > ENOMEM if the allocation fails.
> >
> > Even if it does not cause an ENOMEM failure right away, the guest can
> > also use this to chew up lots of host resources. It may also be worth
> > putting a reasonable cap at the maximum the guest can allocate, rather
> > than just trying to malloc every possible size.
> >
> > --
> > Eric Blake   eblake redhat com    +1-919-301-3266
> > Libvirt virtualization library http://libvirt.org
> >
> >

  reply	other threads:[~2016-10-13  8:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-09  5:25 [Qemu-devel] [PATCH 0/2] 9pfs: fix xattr issues Li Qiang
2016-10-09  5:26 ` [Qemu-devel] [PATCH 1/2] 9pfs: fix information leak in xattr read Li Qiang
2016-10-10  8:56   ` Greg Kurz
2016-10-12 13:23     ` Greg Kurz
2016-10-12 20:49       ` Eric Blake
2016-10-13  3:30         ` Li Qiang
2016-10-13  8:08           ` Greg Kurz [this message]
2016-10-13  7:51         ` Greg Kurz
2016-10-09  5:27 ` [Qemu-devel] [PATCH 2/2] 9pfs: fix memory leak about xattr value Li Qiang
2016-10-10  9:06   ` Greg Kurz
2016-10-10  9:15     ` Li Qiang
2016-10-10 10:21       ` 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=20161013100835.0fba59a2@bahia \
    --to=groug@kaod.org \
    --cc=eblake@redhat.com \
    --cc=liq3ea@gmail.com \
    --cc=liqiang6-s@360.cn \
    --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.