From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51952 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCIzu-0003Zj-FA for qemu-devel@nongnu.org; Sat, 30 Oct 2010 17:29:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PCIzt-0007xU-0l for qemu-devel@nongnu.org; Sat, 30 Oct 2010 17:29:58 -0400 Received: from e6.ny.us.ibm.com ([32.97.182.146]:38828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PCIzs-0007wu-UW for qemu-devel@nongnu.org; Sat, 30 Oct 2010 17:29:56 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e6.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o9ULUVeg017315 for ; Sat, 30 Oct 2010 17:30:31 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9ULTkR9444292 for ; Sat, 30 Oct 2010 17:29:46 -0400 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o9ULTk8B010085 for ; Sat, 30 Oct 2010 15:29:46 -0600 Message-ID: <4CCC8E48.40707@linux.vnet.ibm.com> Date: Sat, 30 Oct 2010 14:29:44 -0700 From: "Venkateswararao Jujjuri (JV)" MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] virtio-9p: Check the return value of llistxattr. References: <20101030025240.0676A6FC03B@msa105.auone-net.jp> In-Reply-To: <20101030025240.0676A6FC03B@msa105.auone-net.jp> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kusanagi Kouichi Cc: qemu-devel@nongnu.org On 10/29/2010 7:52 PM, Kusanagi Kouichi wrote: > If llistxattr returned 0, qemu aborts. > > Signed-off-by: Kusanagi Kouichi Acked-by: Venkateswararao Jujjuri > --- > hw/virtio-9p-xattr.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/hw/virtio-9p-xattr.c b/hw/virtio-9p-xattr.c > index 175f372..1aab081 100644 > --- a/hw/virtio-9p-xattr.c > +++ b/hw/virtio-9p-xattr.c > @@ -73,6 +73,9 @@ ssize_t v9fs_list_xattr(FsContext *ctx, const char *path, > > /* Get the actual len */ > xattr_len = llistxattr(rpath(ctx, path), value, 0); > + if (xattr_len <= 0) { > + return xattr_len; > + } > > /* Now fetch the xattr and find the actual size */ > orig_value = qemu_malloc(xattr_len);