From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BA5F5C2BD09 for ; Mon, 24 Jun 2024 14:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=USWiQTPmfwGqhEnHXIsd2v3omq1oZL2DmA/IWNr47PI=; b=0Wp54qUJ8Pb9YPVd0ol7+4h4bj j+yZkneaMVVTnZfPDhyvBl6CaSfvZ2zKuYvjKKK5HtJfWlQ4EWhyVLf7Z48nUgvdf3WKagJ29Efox 1DtgQHCNtBCy50UMTJdkOGGNYGME2Vm0IcD6k/LPRT2VCYVJJGyRVFe8l6DUBJ2MXVbOUHB/Vz6fy ggnwnLYUBGTjfAjuefBa05R+etxgN6VSJdxG6R/jldi88kKwiJuyqCNu897X7bfGoo1f23HkrTVTD FhLl+shI4QTtK5saheVogCadYPoSg/y/Byrmz1EbLgdC9uYhJTBGer9tBadzlsxno3O97GyvMU6+7 laTmjZwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLkZO-0000000H4Zy-1kJU; Mon, 24 Jun 2024 14:21:22 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sLkZJ-0000000H4XT-0Z3R for linux-arm-kernel@lists.infradead.org; Mon, 24 Jun 2024 14:21:18 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5F45260346; Mon, 24 Jun 2024 14:21:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9769EC4AF0C; Mon, 24 Jun 2024 14:21:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1719238876; bh=Pjqrb8+wFHR1mGeMA625VXKLN5bcap7zHfFbkRKORj8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BW33TQUyWAv0krdvhK3ThO1kHwVz1Ijn+D89YF5vkpPsMtJqcJtqMFIIQnQ7ifqOV vkj9JFgWkLZwm/GiHUdz4L1QukNeI6GDvuL72rEgUYr/Rxz41/0fFQTzsl7eT23krn 4+bM7aQoqB6MfhbBucAgLAuZJG5QAJS1Inv4Mvqo= Date: Mon, 24 Jun 2024 16:21:13 +0200 From: Greg KH To: Ma Ke Cc: neal_liu@aspeedtech.com, joel@jms.id.au, andrew@codeconstruct.com.au, linux-aspeed@lists.ozlabs.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] usb: gadget: aspeed_udc: validate endpoint index for ast udc Message-ID: <2024062400-yearning-curfew-3c9d@gregkh> References: <20240624015314.2249128-1-make24@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240624015314.2249128-1-make24@iscas.ac.cn> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240624_072117_268940_08B74191 X-CRM114-Status: GOOD ( 23.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jun 24, 2024 at 09:53:13AM +0800, Ma Ke wrote: > We should verify the bound of the array to assure that host > may not manipulate the index to point past endpoint array. > > Found by static analysis. > > Signed-off-by: Ma Ke > --- > drivers/usb/gadget/udc/aspeed_udc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/gadget/udc/aspeed_udc.c b/drivers/usb/gadget/udc/aspeed_udc.c > index 3916c8e2ba01..d972ef4644bc 100644 > --- a/drivers/usb/gadget/udc/aspeed_udc.c > +++ b/drivers/usb/gadget/udc/aspeed_udc.c > @@ -1009,6 +1009,8 @@ static void ast_udc_getstatus(struct ast_udc_dev *udc) > break; > case USB_RECIP_ENDPOINT: > epnum = crq.wIndex & USB_ENDPOINT_NUMBER_MASK; > + if (epnum >= AST_UDC_NUM_ENDPOINTS) > + goto stall; > status = udc->ep[epnum].stopped; > break; > default: > -- > 2.25.1 > > Hi, This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree. You are receiving this message because of the following common error(s) as indicated below: - This looks like a new version of a previously submitted patch, but you did not list below the --- line any changes from the previous version. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what needs to be done here to properly describe this. If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers. thanks, greg k-h's patch email bot