From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zc95l-0004QB-6q for qemu-devel@nongnu.org; Wed, 16 Sep 2015 05:33:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zc95h-0006oE-RD for qemu-devel@nongnu.org; Wed, 16 Sep 2015 05:33:29 -0400 Received: from mx5-phx2.redhat.com ([209.132.183.37]:58087) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zc95h-0006o2-Jk for qemu-devel@nongnu.org; Wed, 16 Sep 2015 05:33:25 -0400 Date: Wed, 16 Sep 2015 05:33:19 -0400 (EDT) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <534883311.12512111.1442395999383.JavaMail.zimbra@redhat.com> In-Reply-To: <55F935E4.2030705@huawei.com> References: <1442333283-13119-1-git-send-email-marcandre.lureau@redhat.com> <1442333283-13119-4-git-send-email-marcandre.lureau@redhat.com> <55F935E4.2030705@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 03/46] ivhsmem: read do not accept more than sizeof(long) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Claudio Fontana Cc: marcandre lureau , drjones@redhat.com, cam@cs.ualberta.ca, qemu-devel@nongnu.org, stefanha@redhat.com Hi ----- Original Message ----- > On 15.09.2015 18:07, marcandre.lureau@redhat.com wrote: > > From: Marc-Andr=C3=A9 Lureau > >=20 > > ivshmem_read() only reads sizeof(long) from the input buffer. Acceptin= g > > more could lead to fifo8 abort() on 32bit systems if fifo is not empty. > >=20 > > Signed-off-by: Marc-Andr=C3=A9 Lureau > > --- > > hw/misc/ivshmem.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c > > index cc76989..fb53b3f 100644 > > --- a/hw/misc/ivshmem.c > > +++ b/hw/misc/ivshmem.c > > @@ -272,7 +272,7 @@ static void ivshmem_receive(void *opaque, const uin= t8_t > > *buf, int size) > > =20 > > static int ivshmem_can_receive(void * opaque) > > { > > - return 8; > > + return sizeof(long); > > } > > =20 >=20 > Is the right fix this one, or should ivshmem_read() not rely on sizeof(lo= ng)? See my answer to Paolo: http://lists.nongnu.org/archive/html/qemu-devel/2015-07/msg05341.html >=20 > > static void ivshmem_event(void *opaque, int event) > >=20 >=20 > Ciao, >=20 > Claudio >=20 >=20