Received: from eggs.gnu.org ([2001:4830:134:3::10]:57551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVkrV-0000vY-7f for qemu-devel@nongnu.org; Tue, 16 Feb 2016 14:00:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVkrS-00008S-1Q for qemu-devel@nongnu.org; Tue, 16 Feb 2016 14:00:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:37386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVkrR-00008L-Sa for qemu-devel@nongnu.org; Tue, 16 Feb 2016 14:00:33 -0500 Date: Wed, 17 Feb 2016 00:30:26 +0530 (IST) From: P J P In-Reply-To: <1455633230.7504.107.camel@redhat.com> Message-ID: References: <1454669651-29411-1-git-send-email-ppandit@redhat.com> <1455633230.7504.107.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH] usb: check RNDIS buffer offsets & length List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Qinghao Tang , Qemu Developers Hello Gerd, +-- On Tue, 16 Feb 2016, Gerd Hoffmann wrote --+ | Moves up the check so it is done for every control xfer. Good. ... | Why this is needed? All control transfers go through do_token_setup | first, so with the check moved in do_token_setup we should never ever | trigger it here ... I see, okay. | > - if (bufoffs + buflen > length) | > + if (buflen > length || bufoffs >= length || bufoffs + buflen > length) { | > return USB_RET_STALL; | > + } | | What is this? Not mentioned in the commit message. Looks like integer | overflow prevention to me (if correct: separate patch with proper commit | message please). That's right. I've sent separate revised patches for the above two changes. Thank you. -- Prasad J Pandit / Red Hat Product Security Team 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F