From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43869) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgukp-0006BG-WF for qemu-devel@nongnu.org; Tue, 29 Sep 2015 09:15:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zgukk-0003e6-Nm for qemu-devel@nongnu.org; Tue, 29 Sep 2015 09:15:35 -0400 Received: from lhrrgout.huawei.com ([194.213.3.17]:50711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zgukk-0003e2-Fl for qemu-devel@nongnu.org; Tue, 29 Sep 2015 09:15:30 -0400 References: <1443094669-4144-1-git-send-email-marcandre.lureau@redhat.com> <1443094669-4144-4-git-send-email-marcandre.lureau@redhat.com> From: Claudio Fontana Message-ID: <560A8EEB.8040801@huawei.com> Date: Tue, 29 Sep 2015 15:15:23 +0200 MIME-Version: 1.0 In-Reply-To: <1443094669-4144-4-git-send-email-marcandre.lureau@redhat.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v4 03/47] 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: pbonzini@redhat.com, drjones@redhat.com, cam@cs.ualberta.ca, stefanha@redhat.com On 24.09.2015 13:37, 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. > > A following patch will change the protocol to 64-bit little-endian > instead. > > 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); > } > > static void ivshmem_event(void *opaque, int event) > agreed in light of the successive patch Reviewed-by: Claudio Fontana