From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bub4J-0001w8-Qz for qemu-devel@nongnu.org; Thu, 13 Oct 2016 04:08:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bub4F-0007W0-IY for qemu-devel@nongnu.org; Thu, 13 Oct 2016 04:08:46 -0400 Received: from 1.mo179.mail-out.ovh.net ([178.33.111.220]:44880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bub4F-0007V7-Bh for qemu-devel@nongnu.org; Thu, 13 Oct 2016 04:08:43 -0400 Received: from player792.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo179.mail-out.ovh.net (Postfix) with ESMTP id 83044FFBD84 for ; Thu, 13 Oct 2016 10:08:42 +0200 (CEST) Date: Thu, 13 Oct 2016 10:08:35 +0200 From: Greg Kurz Message-ID: <20161013100835.0fba59a2@bahia> In-Reply-To: References: <6aefc5ee17ba6ac636de56bba8e7f24fd0262187.1475990063.git.liqiang6-s@360.cn> <20161010105603.132a5d53@bahia> <20161012152308.5549fa32@bahia> <62702952-e2d8-fb96-0ed8-94729cd65c4c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] 9pfs: fix information leak in xattr read List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Li Qiang Cc: Eric Blake , Li Qiang , qemu-devel@nongnu.org On Thu, 13 Oct 2016 11:30:08 +0800 Li Qiang 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 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 > > > >