From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk89R-0007lE-FV for qemu-devel@nongnu.org; Tue, 13 May 2014 04:33:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wk89L-0003l2-87 for qemu-devel@nongnu.org; Tue, 13 May 2014 04:33:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38016) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wk89L-0003kx-0u for qemu-devel@nongnu.org; Tue, 13 May 2014 04:33:23 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4D8XMhU005634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 13 May 2014 04:33:22 -0400 Date: Tue, 13 May 2014 11:32:14 +0300 From: "Michael S. Tsirkin" Message-ID: <20140513083214.GD29442@redhat.com> References: <1399896829-16617-1-git-send-email-mst@redhat.com> <1399967409.7118.38.camel@nilsson.home.kraxel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1399967409.7118.38.camel@nilsson.home.kraxel.org> Subject: Re: [Qemu-devel] [PATCH] usb: fix up post load checks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org, dgilbert@redhat.com On Tue, May 13, 2014 at 09:50:09AM +0200, Gerd Hoffmann wrote: > Hi, > > > + (dev->setup_state == SETUP_STATE_DATA && > > Fails to build, SETUP_STATE_DATA is not defined here. > > I think we can simply drop that check, index should never ever be larger > than len, no matter what the state is. > > cheers, > Gerd I'm confused by usb_generic_async_ctrl_complete which can modify len without touching index. If index is stale it could get > len? Could you hop on irc so we can discuss? -- MST