Received: by 10.213.65.68 with SMTP id h4csp656507imn; Tue, 20 Mar 2018 11:57:24 -0700 (PDT) X-Google-Smtp-Source: AG47ELvq5iqB4VDoPgNCDd73pPZGuJdm6XeyUu0jq0HTzo7THFjBSs+iLT5x1bAt0xgIgEoZ9JsO X-Received: by 10.101.97.139 with SMTP id c11mr13110169pgv.447.1521572244068; Tue, 20 Mar 2018 11:57:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521572244; cv=none; d=google.com; s=arc-20160816; b=yQiPy1DqGMfQYCjUe2oRSKUFKyukxSQdHNO0s1yXacNmpKlEzjwuRoRfD9gNybgwPv CdzPcsFoxomICCA0LFiQK1I0Rp02iG+9Y0P8TUBoib5opuPrX0W3ixteoCXY0URz+Iia VJt992ep5Yz/ogKzEoFceZf0Cyk8Uk+Twhz+aVaqZPzw9EMpQnxYcbRomL07IxoBK17w NqBhRlqoNieUt+/yw9qYSI2mATrmfd8Hx5jKqhT6OMzim9kE6vZ2Fmzn5+mgR47NEZYP SOltpaisKDjS2/N0hOOCJmPQKNkqv7JXA2EJTBWvmmxZGlxXqY62GWdctrr5ETBfu+aj Jjaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=ljvVNH1lUt6CxqzfjvdozR+Qozw+uzRFzdLViKPVWTk=; b=O2qx8WfFfhGJ6NVFq/11xyTncWEwGxvqvDMDQBpJY2KXqK+5/P7jT9HOBj4Qefn17T l5Ik1Di5L7pUJThniWiMuE+xBFRvZpMAy/xND/Pg0/ITcndrJvYW0XADFtxleUyUle2E 8tBtHPJx8e8yjteZohcqPuL57ACrr+Ef6Ziyp6gsdt0ZesjBJ3iQ2xacIWgOemOq1S2Z X17W/9/Pmh4Ix/ylgKaVRo/NpziDYne4D01fpm9P9UF0+DnrOzw86Sh7MyTL7bY5GD5P 450FN/kvCZ8nid0m7KAYOqZARWhUxShJl9V7VhJJ7n61sdc87svawtcq+5xr01TJ00LD I+EA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mioCCCAv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h16-v6si2059171pli.408.2018.03.20.11.57.08; Tue, 20 Mar 2018 11:57:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mioCCCAv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751550AbeCTS4D (ORCPT + 99 others); Tue, 20 Mar 2018 14:56:03 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:24378 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbeCTS4A (ORCPT ); Tue, 20 Mar 2018 14:56:00 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w2KItu2T007849; Tue, 20 Mar 2018 13:55:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1521572156; bh=NFcZYOMGIsmx0q27zpeMQmV76S9c+tb9ePAtp/cTI6I=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=mioCCCAvjXf07Qft3bC8lO4jLkhp/nDFMTrwTHTS9neLdFhg1DvCh/MataVrG4cZd T/MxCmwRd3jfbuuJ995Gkdz253Wv8kelVrhru2W8PE4OmKpn8qD8qMsA06tBsp5rwS hKN8bfPftxvgAizmq4C22Rr2NtBzPNvM7Cwmobjw= Received: from DLEE100.ent.ti.com (dlee100.ent.ti.com [157.170.170.30]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w2KIttG0004060; Tue, 20 Mar 2018 13:55:55 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE100.ent.ti.com (157.170.170.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Tue, 20 Mar 2018 13:55:55 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Tue, 20 Mar 2018 13:55:55 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w2KItt9i018708; Tue, 20 Mar 2018 13:55:55 -0500 Date: Tue, 20 Mar 2018 13:55:55 -0500 From: Bin Liu To: Heinrich Schuchardt CC: Sergei Shtylyov , Greg Kroah-Hartman , , Subject: Re: [PATCH v3 1/1] usb: musb: gadget: misplaced out of bounds check Message-ID: <20180320185555.GY14921@uda0271908> Mail-Followup-To: Bin Liu , Heinrich Schuchardt , Sergei Shtylyov , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180320184248.11962-1-xypron.glpk@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20180320184248.11962-1-xypron.glpk@gmx.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Mar 20, 2018 at 07:42:48PM +0100, Heinrich Schuchardt wrote: > musb->endpoints[] has array size MUSB_C_NUM_EPS. > We must check array bounds before accessing the array and not afterwards. > > Signed-off-by: Heinrich Schuchardt > --- > v3 > Remove superfluous braces. > v2 > Only the 4 low bits of epnum are relevant for indexing. > --- > drivers/usb/musb/musb_gadget_ep0.c | 14 +++++++++----- > 1 file changed, 9 insertions(+), 5 deletions(-) Applied. Thanks. Regards, -Bin.