From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=211.20.114.72 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796282810; b=nnjjNz3HGs6o8IbPtd3EjVGPVNM9vtGKa2jvAkDAgTuY4zIa+6+82HnOuNEH7LloWdFU WSBuwroJg8TSYRjNlq6NPdGS/PBRFBGuTiZv3+5ZC4trwCAknegWzYvXvJwP1f83C+DAg N0dtiQMvof2X9xuOPHZc72IgztPmv0PdUTIo3BMIDyH3t3cTW1G2ptDkTPGTbYRXp1L5d Nh0xQvkM5boTJfUDA4ErAMbvQFuTXIJI8ICpVXT987+5STuvFPqF+OBCytAY2OBGmayzd lBmCbBeifXnHvgjFoHfHNOoF3OA9FGnRK2JX+L+p81adWMYLhVsgo/74HHhvJd5TvEA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796282810; h=DMARC-Filter:Received:Received:From:To:CC:Subject:Date:Message-ID: X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Content-Type; bh=9lGD8fTsnj+2EVLhb1EgHOs4rq9mNF3IxegfgZCu1cU=; b=jiPf00/2Kpg4MLv3vgOPJyspaJ8DukrfXPhe6+CNjhhVCXcjYQBrU0X6cFdWCTLHnozG f5K0tY+x5wowmI3r6YZurN8CiAxU6vY1muI40VjPfy75RAiEL/3QbqV+1Z9LALGot/iWa /XPD28+0lb6m+VfVSjOFnVefuWhgGEbR6Wx2iEJ//I7tALH9XvkPqRCKW13cjyA+JtwcW 3zxE6YmiqeW+8eKS5pY1qM+95aXutNcG2uRSA0CLWGZJNX55P62jDFPMDYJ+PMzQyyYJC lfYSJweEl1T4zePLhVZJ+Pk+JOp+BnvH1z1NGY8TVi6kjrfxJ/TkOsE/bSg//02m9UA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=aspeedtech.com; spf=pass smtp.mailfrom=aspeedtech.com; arc=none smtp.remote-ip=211.20.114.72 Received: from twmbx01.aspeedtech.com (mail.aspeedtech.com [211.20.114.72]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F214C606A32C; Thu, 3 Dec 2026 07:26:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F214C606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=aspeedtech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aspeedtech.com Received: from TWMBX01.aspeed.com (192.168.0.62) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.39; Thu, 3 Dec 2026 15:26:47 +0800 Received: from mail.aspeedtech.com (192.168.10.13) by TWMBX01.aspeed.com (192.168.0.62) with Microsoft SMTP Server id 15.2.1748.39 via Frontend Transport; Thu, 3 Dec 2026 15:26:47 +0800 From: Joe Wang To: TAKANO Mitsuhiro CC: Neal Liu , Neill Kapron , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , Ryan Chen , Billy Tsai , , , , Subject: Re: [PATCH] usb: gadget: aspeed_udc: validate pointers before dereferencing in ast_udc_ep_enable() Date: Thu, 3 Dec 2026 15:26:47 +0800 Message-ID: <20261203072647.3026031-1-joe_wang@aspeedtech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20261128-b4-aspeed-udc-ep-enable-null-v1-1-26e41e0cd96b@gmail.com> References: <20261128-b4-aspeed-udc-ep-enable-null-v1-1-26e41e0cd96b@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain Hi Takano, > In ast_udc_ep_enable(), desc and ep are dereferenced in local variable > initializers (usb_endpoint_maxp(desc), ep->udc, and usb_endpoint_num(desc)) > before checking whether _ep or desc is NULL. In addition, the error path > calls EP_DBG(ep, ...), which dereferences ep->udc and ep->ep.name when > AST_EP_DEBUG is enabled. Thanks for the patch, but I don't think this change is needed. ast_udc_ep_enable() is only reached through ep->ops->enable(), and the only caller of that is usb_ep_enable() in udc/core.c. usb_ep_enable() already dereferences ep (ep->enabled) before the call, and it returns -EINVAL with a WARN if ep->desc is NULL or its maxpacket is 0, so _ep and desc can never be NULL by the time ast_udc_ep_enable() runs. Because of that there is no NULL dereference to fix here, and the Fixes: tag does not apply. Thanks, Joe Wang