Received: from eggs.gnu.org ([2001:4830:134:3::10]:59850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2Ffu-0003hI-58 for qemu-devel@nongnu.org; Wed, 02 Jul 2014 04:13:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2Ffo-0006Ms-HB for qemu-devel@nongnu.org; Wed, 02 Jul 2014 04:13:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36541) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2Ffo-0006Mc-94 for qemu-devel@nongnu.org; Wed, 02 Jul 2014 04:13:48 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s628DkKN027806 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 2 Jul 2014 04:13:46 -0400 Date: Wed, 2 Jul 2014 10:13:44 +0200 From: Stefan Hajnoczi Message-ID: <20140702081344.GB4660@stefanha-thinkpad.redhat.com> References: <1404226342-20174-1-git-send-email-kwolf@redhat.com> <1404226342-20174-2-git-send-email-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UHN/qo2QbUvPLonB" Content-Disposition: inline In-Reply-To: <1404226342-20174-2-git-send-email-kwolf@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-2.1 1/2] mirror: Fix qiov size for short requests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org --UHN/qo2QbUvPLonB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 01, 2014 at 04:52:21PM +0200, Kevin Wolf wrote: > When mirroring an image of a size that is not a multiple of the > mirror job granularity, the last request would have the right nb_sectors > argument, but a qiov that is rounded up to the next multiple of the > granularity. Don't do this. >=20 > This fixes a segfault that is caused by raw-posix being confused by this > and allocating a buffer with request length, but operating on it with > qiov length. >=20 > Reported-by: Eric Blake > Signed-off-by: Kevin Wolf > --- > block/mirror.c | 4 +++- > tests/qemu-iotests/041 | 5 +++++ > tests/qemu-iotests/041.out | 4 ++-- > 3 files changed, 10 insertions(+), 3 deletions(-) Applied Eric's suggestion. Thanks, applied to my block tree: https://github.com/stefanha/qemu/commits/block Stefan --UHN/qo2QbUvPLonB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTs784AAoJEJykq7OBq3PIXDoH/3vO0xuQ8cWhQsZ9R54N2DK7 BRjsddD5RHUNx3wQhGyXJcJ5hS+uwjTnZyHelv8/qgpAzJ/HQl8L6p+Mlq8VmQyQ HXd3VcfU6C8bCl+N91Jf5IBFjXJQ+oEEnRuzrTx0nfkHuzcc5UHlvkvSAy7tKWnt 3yoIjZ7azcrtiIhk3PqIaVfZS0ZNdomNLO4I4l00AZEOWOC3Ni/v6rqItNQKHdoY QBRnciSmy4Qpdyw1I7nLVUMXyoA90VAKS6XHHM35luaxdvFmgpXDYXnIIOGAJ9v3 bX0gqB/Tk5tb3sFA9t+Ft7j22+4j9xxvEtkuCaiGxIPuN2oBuaAG/OClTQ4xpaU= =/Sut -----END PGP SIGNATURE----- --UHN/qo2QbUvPLonB--