From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zc8ze-0004bF-Cd for qemu-devel@nongnu.org; Wed, 16 Sep 2015 05:27:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zc8zZ-0004TS-Ae for qemu-devel@nongnu.org; Wed, 16 Sep 2015 05:27:10 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:29154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zc8zY-0004TH-Pr for qemu-devel@nongnu.org; Wed, 16 Sep 2015 05:27:05 -0400 References: <1442333283-13119-1-git-send-email-marcandre.lureau@redhat.com> <1442333283-13119-4-git-send-email-marcandre.lureau@redhat.com> From: Claudio Fontana Message-ID: <55F935E4.2030705@huawei.com> Date: Wed, 16 Sep 2015 11:27:00 +0200 MIME-Version: 1.0 In-Reply-To: <1442333283-13119-4-git-send-email-marcandre.lureau@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit 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: marcandre.lureau@redhat.com, qemu-devel@nongnu.org Cc: drjones@redhat.com, cam@cs.ualberta.ca, stefanha@redhat.com On 15.09.2015 18:07, marcandre.lureau@redhat.com wrote: > From: Marc-André Lureau > > ivshmem_read() only reads sizeof(long) from the input buffer. Accepting > more could lead to fifo8 abort() on 32bit systems if fifo is not empty. > > Signed-off-by: Marc-André Lureau > --- > hw/misc/ivshmem.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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 uint8_t *buf, int size) > > static int ivshmem_can_receive(void * opaque) > { > - return 8; > + return sizeof(long); > } > Is the right fix this one, or should ivshmem_read() not rely on sizeof(long)? > static void ivshmem_event(void *opaque, int event) > Ciao, Claudio