From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795904843; b=qMmPChyHQopSEZesFNzLNVKPi29mzrndBx7G+DFnW3hRYOGTNwBMnW11o4AHL4pTzVsH c1T5WU18FyjGZMuX0GZ769OCwFgfzWOE37JUiA9eHfcsmmROs4SneUkjdNVQD14a/gtgh Va7k3UtKhEGV8HufbHfZVRMVJQsQPs78sFcpVgKU5Xylx+6OfidFnIItYsCiuf94bbVKL TvoeTkqaRKH3jqtpwpzcrTwgotJoO8x+N4lYGCMssrUeS2Yf9zIU8wLqfR9ouoGEpifQv fw0sXu99U0ZysNThWiiDj/fEno6tliTvXQAVzrs+ZvwCnMwJSOb7aK6/437XGq9PAGA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795904843; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Hh74iVpCBns3/l2LoF50R4Me7kFB/go3NzNxh78bVbE=; b=N/sE5v6EA2iDAzHL7n+sUu8NOGbn+T8Fmitif3EM/P0Zx0NvKmcwmCMvCeyioAh7nd6t d3bq8Tz97BdJPuFtxT0OnB8hDQ5H6JNE+vozsuhB/Ie3E+H/9FI4XxDG4RuYgtEMFCt66 UJHTu4ybJwXWZRayJFBZO/XWNVqNFvZh6ySSvsN351JScemObs08hfa8ijghKk2PwO8pz ksiTYt0LiT1d8aHww8uXE3Q5/M/odLs4fXFSMEEzrlJ/vHIr3wlZKEgMwRlcHNOSsfwFb XB1aL0rCpkBGhYmkJPk4fjMWxQy49fTPWNY7/D8s6b5ciOhJta0dPKPuhTqqec/0ZuQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dfOk5ehR; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9EE0606A31C for ; Sat, 28 Nov 2026 22:27:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=dfOk5ehR Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8377B1F00893; Sat, 28 Nov 2026 22:27:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795904843; bh=Hh74iVpCBns3/l2LoF50R4Me7kFB/go3NzNxh78bVbE=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=dfOk5ehRFWWj275DC53x3gd6GqJpLSAPA/ZMneUhoxqg5WLEIyQ009wCRNuENtEwM elTnTquWjiEFTUZcGvBh/sa59aMj0bKnBNGu8UQoIY5ajfdIoBo5mx/e669nefYZKU 1dIwSKq3XeEHoKWS3GQOZJQ4FwbclyjNjas15BMqhSygeNGge24ru2EPYGMHXJxTec CLPe8j532hly+dl/WTjHuSJg2r92inqoCcJgzIgDYxYFqWzrLoWXnD0A4oUrEgq53z UmvcWOfsT/psTWigVB8pOLThSVbic0eJySnpqW/fIkSwrCGgzJ0fod3y6eAFtYh+zm 4XRVUDQI7aWqQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] usb: gadget: aspeed_udc: validate pointers before dereferencing in ast_udc_ep_enable() Reply-To: sashiko-reviews@lists.linux.dev To: "TAKANO Mitsuhiro" Cc: linux-usb@vger.kernel.org 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> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Sat, 28 Nov 2026 22:27:23 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list > From: TAKANO Mitsuhiro >=20 > 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. >=20 > Check _ep and desc for NULL first, then derive ep, udc, maxpacket, and > epnum. Since _ep is already verified non-NULL, the redundant !ep check > after container_of() is also removed. >=20 > Fixes: 055276c13205 ("usb: gadget: add Aspeed ast2600 udc driver") > Signed-off-by: TAKANO Mitsuhiro Sashiko has reviewed this patch and found no issues. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261128-b4-aspeed-= udc-ep-enable-null-v1-1-26e41e0cd96b@gmail.com?part=3D1