From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1tP4-0002eY-A1 for qemu-devel@nongnu.org; Mon, 08 Jun 2015 05:31:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z1tOz-00062x-AC for qemu-devel@nongnu.org; Mon, 08 Jun 2015 05:31:34 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:34789) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z1tOy-00062N-Sp for qemu-devel@nongnu.org; Mon, 08 Jun 2015 05:31:29 -0400 Received: by wibut5 with SMTP id ut5so79452207wib.1 for ; Mon, 08 Jun 2015 02:31:28 -0700 (PDT) Date: Mon, 8 Jun 2015 10:31:25 +0100 From: Stefan Hajnoczi Message-ID: <20150608093125.GF30104@stefanha-thinkpad.redhat.com> References: <3a37931fe0e17adc26bdaa23e33f0aa8.squirrel@gator4003.hostgator.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uTRFFR9qmiCqR05s" Content-Disposition: inline In-Reply-To: <3a37931fe0e17adc26bdaa23e33f0aa8.squirrel@gator4003.hostgator.com> Subject: Re: [Qemu-devel] segfault in memcmp List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: perrier vincent Cc: qemu-devel@nongnu.org, Gerd Hoffmann --uTRFFR9qmiCqR05s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 05, 2015 at 05:19:53PM -0500, perrier vincent wrote: > Using a very old guest (lenny) with spice and vga=3Dcirrus, I have > a segfault: >=20 > FILE: ui/spice-display.c > FUNCTION: qemu_spice_create_update > LINE: if (memcmp(guest + yoff + xoff, > mirror + yoff + xoff, > bw * bpp) =3D=3D 0) >=20 > The address of mirror + yoff + xoff is out of boundaries. >=20 > I use the following to avoid the crash: >=20 > ... > img_get_stride =3D pixman_image_get_stride(ssd->mirror); > img_height =3D pixman_image_get_height(ssd->mirror); > img_max =3D img_height * img_get_stride; > ... > if (yoff > img_max) > { > if (dirty_top[blk] =3D=3D -1) > dirty_top[blk] =3D y; > } > else if (memcmp(guest + yoff + xoff, > mirror + yoff + xoff, > bw * bpp) =3D=3D 0) > { > ... Thanks for the report. I have CCed Gerd Hoffmann who maintains the graphics subsystem. --uTRFFR9qmiCqR05s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVdWDtAAoJEJykq7OBq3PILIwH/0IZfvqhrXSsNUYl4HmqxzpV NarV30lbbqP6xraCH8q4BF3ltdLTMIng7c9+r5+ztuA+dQ9CKaVPUWw15rv4e/l5 z5TUpF2EfUpiM6JzTuQg2Oz70jsOEsFNkE0gbxhQhxXBciXl+0xITdvyj7jvF6Sg h1dUt2FqASegbj2A7z5eDq/QzPJ3ASNXB8EC5C6hD5gEgi2QAg9feekzEVo5xtRK hDmnMHZ1uGnJ4kde0V4G64a0EGDvI5ji31MHaQDMeJIv2eAwU91OrR07StAoF64b PbtePAaTO0VtAc3/tj3jAsvw3HQDKzeTr5mCNMichmPhsKw3TZ2ehm6ckHTvL+M= =aRkP -----END PGP SIGNATURE----- --uTRFFR9qmiCqR05s--