From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aL3cw-00046B-Bz for qemu-devel@nongnu.org; Mon, 18 Jan 2016 01:49:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aL3cv-0001Z6-IP for qemu-devel@nongnu.org; Mon, 18 Jan 2016 01:49:22 -0500 References: <1452841240-30377-1-git-send-email-ppandit@redhat.com> <569C54B6.3010404@redhat.com> From: Jason Wang Message-ID: <569C8ADF.8050607@redhat.com> Date: Mon, 18 Jan 2016 14:49:03 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] net: cadence_gem: check packet size in gem_recieve List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: P J P Cc: qemu-arm , QEMU Developers , Ling Liu , "Michael S. Tsirkin" On 01/18/2016 01:34 PM, P J P wrote: > +-- On Mon, 18 Jan 2016, Jason Wang wrote --+ > | > + if (size > sizeof(rxbuf) - sizeof(crc_val)) { > | > + size = sizeof(rxbuf) - sizeof(crc_val); > | > + } > | > + bytes_to_copy = size; > | > + > | > | We probably need more check, is there any guarantee that size <= 2048? > | If not, need fix. > > Sorry? The above check would fix that, no? You're right. Apply to my -net (and removing the unnecessary whitespace change). Thanks > -- > - P J P > 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F