From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuHqj-0000vj-9H for qemu-devel@nongnu.org; Mon, 18 May 2015 06:00:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuHqa-00061Q-Hl for qemu-devel@nongnu.org; Mon, 18 May 2015 06:00:41 -0400 Date: Mon, 18 May 2015 11:00:27 +0100 From: Stefan Hajnoczi Message-ID: <20150518100027.GC2679@stefanha-thinkpad.redhat.com> References: <1431522721-3266-1-git-send-email-famz@redhat.com> <1431522721-3266-3-git-send-email-famz@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sHrvAb52M6C8blB9" Content-Disposition: inline In-Reply-To: <1431522721-3266-3-git-send-email-famz@redhat.com> Subject: Re: [Qemu-devel] [PATCH v7 2/3] block: Fix NULL deference for unaligned write if qiov is NULL List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: Kevin Wolf , pbonzini@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-stable@nongnu.org --sHrvAb52M6C8blB9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 13, 2015 at 01:12:00PM +0000, Fam Zheng wrote: > For zero write, callers pass in NULL qiov (qemu-io "write -z" or > scsi-disk "write same"). >=20 > Commit fc3959e466 fixed bdrv_co_write_zeroes which is the common case > for this bug, but it still exists in bdrv_aio_write_zeroes. A simpler > fix would be in bdrv_co_do_pwritev which is the NULL dereference point > and covers both cases. >=20 > So don't access it in bdrv_co_do_pwritev in this case, use three aligned > writes. >=20 > Signed-off-by: Fam Zheng > --- > block/io.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++-- > 1 file changed, 95 insertions(+), 2 deletions(-) Reviewed-by: Stefan Hajnoczi --sHrvAb52M6C8blB9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVWbg7AAoJEJykq7OBq3PIDSYH+wVcHP55KOaoVUMRYW+aq5Qn iRMGTCig6wvi0PB48QvYQTWs0wSxTF22ui3AScborSgoX5ETG3G511GcK76l3YID RsWrodMIcNHwBdVmxq5wJPoKduxM/8ajwl6I2o8nq5h8v8kL2y9DO+W3n/MvCygH tBEI7G6G/dzJ0udXuPl2z0/uzBhjg1tZh/WRDp5lwWZUX3naDh5bVub2kRveHm4Z wTEryv1Nz2zXJ56bov1Ti/RqG8BJfsYkqe5SsiQLtSpuzB5/+VnOgmvkUQssCLdj Fj771F8n5lw/yCcR5wq2en2ivJlaQav0zuNDN+2h23Ez3psFo4QK8UkYwQOnAig= =5Rbs -----END PGP SIGNATURE----- --sHrvAb52M6C8blB9--