From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52802) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzkdA-0004Dy-Ju for qemu-devel@nongnu.org; Wed, 25 Jun 2014 06:40:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wzkd3-0004xe-He for qemu-devel@nongnu.org; Wed, 25 Jun 2014 06:40:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wzkd3-0004xW-6u for qemu-devel@nongnu.org; Wed, 25 Jun 2014 06:40:37 -0400 Date: Wed, 25 Jun 2014 12:40:28 +0200 From: Kevin Wolf Message-ID: <20140625104028.GC5581@noname.redhat.com> References: <20140619191312.10674.6213.malonedeb@soybean.canonical.com> <20140619191955.7240.23518.malone@chaenomeles.canonical.com> <20140623080238.GC13485@stefanha-thinkpad.redhat.com> <20140624153624.GK3458@noname.redhat.com> <20140625094215.GB5581@noname.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [Bug 1332297] Re: qemu-img: crash on check of an image with large value in the 'size' header field List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "M.Kustova" Cc: Stefan Hajnoczi , qemu-devel@nongnu.org, Bug 1332297 <1332297@bugs.launchpad.net> Am 25.06.2014 um 11:54 hat M.Kustova geschrieben: > On Wed, Jun 25, 2014 at 1:42 PM, Kevin Wolf wrote: > > Am 25.06.2014 um 11:32 hat M.Kustova geschrieben: > >> On Tue, Jun 24, 2014 at 7:36 PM, Kevin Wolf wrote: > >> > Am 24.06.2014 um 15:19 hat M.Kustova geschrieben: > >> >> On Mon, Jun 23, 2014 at 12:02 PM, Stefan Hajnoczi wrote: > >> >> > On Thu, Jun 19, 2014 at 07:19:55PM -0000, Maria Kustova wrote: > >> >> >> The bug description missed qemu-img error: > >> >> >> > >> >> >> (process:12283): GLib-ERROR **: gmem.c:110: failed to allocate > >> >> >> 18446744059294601304 bytes > >> >> > > >> >> > Thanks, there has been recent work by Kevin Wolf to handle memory > >> >> > allocation failures gracefully without terminating QEMU. This sounds > >> >> > like a candidate for g_try_malloc() and friends. > >> >> > > >> >> > Does the following patch series solve the problem? > >> >> > https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg01275.html > >> >> > >> >> These patches are conflicting with current master. So I can't test > >> >> them as they are. > >> >> > >> >> Do you have a developer repository or branch containing these patches, > >> >> so I could test it on the pre-release base? > >> > > >> > I'm just about to send a new version, I'll keep you CCed there. > >> > >> "[PATCH v4 21/21] qcow2: Return useful error code in refcount_init()" > >> is still broken for the current master. > > > > In which way? I can cleanly apply the whole patch series on master (even > > tried applying the emails from my inbox to be sure). > > Beginning from line #49 in master: > > if (s->refcount_table_size > 0) { > BLKDBG_EVENT(bs->file, BLKDBG_REFTABLE_LOAD); > ret = bdrv_pread(bs->file, s->refcount_table_offset, > > The patch: > > if (s->refcount_table_size > 0) {^M > if (s->refcount_table == NULL) {^M > + ret = -ENOMEM;^M > goto fail;^M > }^M > BLKDBG_EVENT(bs->file, BLKDBG_REFTABLE_LOAD);^M > ret = bdrv_pread(bs->file, s->refcount_table_offset,^M > > At least master version doesn't have this condition. It is code added in patch 11 of the same series. Kevin