Received: from eggs.gnu.org ([2001:4830:134:3::10]:55192) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apWPL-0006EY-S9 for qemu-devel@nongnu.org; Mon, 11 Apr 2016 03:37:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1apWPI-0001yq-M2 for qemu-devel@nongnu.org; Mon, 11 Apr 2016 03:37:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1apWPI-0001ya-HG for qemu-devel@nongnu.org; Mon, 11 Apr 2016 03:37:12 -0400 Date: Mon, 11 Apr 2016 13:07:00 +0530 (IST) From: P J P In-Reply-To: <87r3ehwhia.fsf@dusky.pond.sub.org> Message-ID: References: <1460024762-14592-1-git-send-email-ppandit@redhat.com> <87r3ehwhia.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH] net: mipsnet: check packet length against buffer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: Qemu Developers , Oleksandr Bazhaniuk , Jason Wang +-- On Thu, 7 Apr 2016, Markus Armbruster wrote --+ | P J P writes: | | > --- a/hw/net/mipsnet.c | > +++ b/hw/net/mipsnet.c | > @@ -82,6 +82,9 @@ static ssize_t mipsnet_receive(NetClientState *nc, const uint8_t *buf, size_t si | > if (!mipsnet_can_receive(nc)) | > return 0; | > | > + if (size >= sizeof(s->rx_buffer)) { | > + return 0; | > + } | > s->busy = 1; | | Prompted by Peter Maydell's review of the buddy patch to stellaris_enet: | What does the physical device do when it receives such a packet? I tried to find a device specification, but couldn't find any reference MIPSnet. Jason, wdyt? -- Prasad J Pandit / Red Hat Product Security Team 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F