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 E2F94EB64DD for ; Wed, 5 Jul 2023 07:16:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Arnb5QKesGVBVVmRT7v9cOQxODJrgabOkt9VTO0wLD4=; b=whw5zQr3yUt6FH TPYzGSAqdki3upY3QvPFMLHFVSFp9+oi9LReFT85ADfLcFS50hcZUCShInbAJP2dG24Yo4xmTvzJ9 KdM3oensATddqJTcvAxbOxqzr52in5vATO3gUgwJXi1uKu6NzW6nec+ygHxV39HtZ9i4l0WdrUO1d e+uK9mj7T7v/2jQ4WezZDoau8eGFoDyWjpAxkHpAhbq+nqBOOI90gLwCkZpA4FewQZpWAlHuuiVI/ 8d0nvnabRinWp1JEjAi2wiQHYqEHZKJzB/R8g+U00ZQlGmsuSeB0DFKBOONLQeWpnOoNBWnFFVOEn 18bZX4GrcL+uHIqMvEeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qGwkS-00F1Jq-0q; Wed, 05 Jul 2023 07:16:24 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qGwkP-00F1JA-1h; Wed, 05 Jul 2023 07:16:22 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0B13E6143D; Wed, 5 Jul 2023 07:16:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24B7BC433C8; Wed, 5 Jul 2023 07:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1688541380; bh=o58/JqrKgnTTM59z0X9VKVpJhnUEaXu99mh7Van6qxo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=miagon6woTT1uw7fg/JNoEkEawgoRNFkjSS6kH++z2O8gB6wAsrWi7STLDEuM5dVK EtPAQHC4Vt0OHyYBrU77zZjCdFl+axL9cwmwUiLQycc8KCR3wVRUBpkhIxlceko5Yc qzgoYBe+EhhPREPEhZEZOBeTWkbDH7oFKpxaBiDA= Date: Wed, 5 Jul 2023 08:16:18 +0100 From: Greg KH To: Yu Hao Cc: chunfeng.yun@mediatek.com, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel Subject: Re: [PATCH] usb: mtu3: Fix possible use-before-initialization bug Message-ID: <2023070559-removable-emotion-70f1@gregkh> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230705_001621_622281_012AB1B2 X-CRM114-Status: GOOD ( 25.05 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Jul 04, 2023 at 04:25:50PM -0700, Yu Hao wrote: > The struct usb_ctrlrequest setup should be initialized in the function > ep0_read_setup(mtu, &setup). However, inside that function, > the variable count could be 0 and the struct usb_ctrlrequest setup > is not initialized. But there is a read for setup.bRequestType. > > Signed-off-by: Yu Hao > --- > drivers/usb/mtu3/mtu3_gadget_ep0.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/mtu3/mtu3_gadget_ep0.c > b/drivers/usb/mtu3/mtu3_gadget_ep0.c > index e4fd1bb14a55..67034fa515d0 100644 > --- a/drivers/usb/mtu3/mtu3_gadget_ep0.c > +++ b/drivers/usb/mtu3/mtu3_gadget_ep0.c > @@ -638,7 +638,7 @@ static int ep0_handle_setup(struct mtu3 *mtu) > __releases(mtu->lock) > __acquires(mtu->lock) > { > - struct usb_ctrlrequest setup; > + struct usb_ctrlrequest setup = {}; > struct mtu3_request *mreq; > int handled = 0; > > -- > 2.34.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: - Your patch is malformed (tabs converted to spaces, linewrapped, etc.) and can not be applied. Please read the file, Documentation/process/email-clients.rst in order to fix 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel