From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55047 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OamZP-0006z8-0v for qemu-devel@nongnu.org; Mon, 19 Jul 2010 05:23:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OamZM-0003vo-MY for qemu-devel@nongnu.org; Mon, 19 Jul 2010 05:23:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27701) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OamZM-0003vR-Er for qemu-devel@nongnu.org; Mon, 19 Jul 2010 05:23:28 -0400 Message-ID: <4C44197E.2020102@redhat.com> Date: Mon, 19 Jul 2010 11:23:10 +0200 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] block migraton: check sectors before shift operation. References: <1279514742-6941-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> In-Reply-To: <1279514742-6941-1-git-send-email-tamura.yoshiaki@lab.ntt.co.jp> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yoshiaki Tamura Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, armbru@redhat.com Am 19.07.2010 06:45, schrieb Yoshiaki Tamura: > Commit d246673dcb9911218ff555bcdf28b250e38fa46c has expanded the types > of block drive that can be initialized for block migration. Although > bdrv_getlength() may return < 0, current code shifts it without > checking. This makes block migration initialization invalid and > results in abort() due to calling qemu_malloc() with 0 size at > bdrv_set_dirty_tracking(). This patch checks the return value of > bdrv_getlength() by masking with BDRV_SECTOR_MASK. > > Signed-off-by: Yoshiaki Tamura I applied a similar patch by Shahar Havivi to the block branch a few days ago. Kevin