From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-02.galae.net (smtpout-02.galae.net [185.246.84.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DE0E5C613 for ; Mon, 23 Mar 2026 08:25:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.84.56 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774254316; cv=none; b=n8LlivOhdXLMfP8D6Uh5K8+Q7dcEb42mcZUS3bquSCXaV9Xpbc+y9jKsEi3ivnrgVK0r5RrIBQiTuRD9NfJmotZS6UH/I7C9w3ivuciwKRKudl9dWdUOAzTZsKxIsXENOoau9bdk7Wryo8lc4Nb63Snd8kvnf6gZXL+xJgvWqYM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774254316; c=relaxed/simple; bh=U7bfSoHt7ivbx15dUz2SY1+Pf3DqKNSkCXdX1wjcn/4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=qL/kskYMUxWPExXdaalFhpwhTiZwiLsEXI0e0HYUMIlPow+tB+d0KBxDW2XLu24GDIpPnLCNu9UX+BowDUg5c/duGAyB2IFLbigW51bjAcBSEKfxskrjNPfAtH2T9RetbwVlg8ODfZeC0bJugfzQDMIrVqb/Fl4nE9RlPFxfQOA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=aSi+6Ih2; arc=none smtp.client-ip=185.246.84.56 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="aSi+6Ih2" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-02.galae.net (Postfix) with ESMTPS id BD6181A2F8B; Mon, 23 Mar 2026 08:25:03 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 93FC35FEF6; Mon, 23 Mar 2026 08:25:03 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 1BFBD103711DA; Mon, 23 Mar 2026 09:25:00 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1774254303; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=GxJlqGunZINxuXYx3734E/Fx2QUE0rEf/Saw3FeTMlI=; b=aSi+6Ih2GDw84lAdN6ePL2+2NK+JuudBBoZZthaFWXAJ0rcRguSlYVRU7aRpZmQT1Az5Ch xq84Emd5y783Iw5Xm5a7RLnYpOPKy5rqQktCQpG3XVHuVs4f9LH3g+Gl9EwXtMLfYLlNKC BPP6HTLzN2H8xb7yAQIF3xF0ovxQDAFyWn9NlioinUxfSwcVIWOjod9KPz8dSrk7vCUrOb v9PiA8GzIu/IE5eZy3C1+ss9TxFRQDDDH76lXHujgxIDbI6Su0gb2xJCVsla3XaqisDgN8 zXaLT7ho028v/Pgw7X6Xd/wKW1TlGtLYypbOD33F+W9m3amssapp6XqE7JpxmQ== From: Romain Gantois To: linux-kernel@vger.kernel.org, Pengpeng Hou , Felix Gu Cc: pengpeng@iscas.ac.cn, Arnd Bergmann , Greg Kroah-Hartman Subject: Re: [PATCH] misc: ti_fpc202: fix port ID bounds check Date: Mon, 23 Mar 2026 09:25:00 +0100 Message-ID: <4723113.LvFx2qVVIh@fw-rgant> In-Reply-To: <20260322031923.57994-1-pengpeng@iscas.ac.cn> References: <20260322031923.57994-1-pengpeng@iscas.ac.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2405237.ElGaqSPkdT"; micalg="pgp-sha512"; protocol="application/pgp-signature" X-Last-TLS-Session-Version: TLSv1.3 --nextPart2405237.ElGaqSPkdT Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Romain Gantois Subject: Re: [PATCH] misc: ti_fpc202: fix port ID bounds check Date: Mon, 23 Mar 2026 09:25:00 +0100 Message-ID: <4723113.LvFx2qVVIh@fw-rgant> In-Reply-To: <20260322031923.57994-1-pengpeng@iscas.ac.cn> References: <20260322031923.57994-1-pengpeng@iscas.ac.cn> MIME-Version: 1.0 Hello, On Sunday, 22 March 2026 04:19:23 CET Pengpeng Hou wrote: > The probe path accepts `port_id == FPC202_NUM_PORTS` even though the > driver stores per-port state in `addr_caches[2][2]` and > `probed_ports` is indexed by the same range. That lets a device-tree > node with `reg = <2>` flow into `fpc202_write_dev_addr()` and > `fpc202_detach_addr()`, where the driver indexes > `addr_caches[port_id][dev_num]`. > > Change the probe check to reject port ID values at or above the number > of supported ports. > > Signed-off-by: Pengpeng Hou > --- > > drivers/misc/ti_fpc202.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/ti_fpc202.c b/drivers/misc/ti_fpc202.c > index 8eb2b5ac9850..578feefb77f1 100644 > --- a/drivers/misc/ti_fpc202.c > +++ b/drivers/misc/ti_fpc202.c > @@ -366,7 +366,7 @@ static int fpc202_probe(struct i2c_client *client) > > goto unregister_chans; > > } > > - if (port_id > FPC202_NUM_PORTS) { > + if (port_id >= FPC202_NUM_PORTS) { There is an existing series by Felix Gu which fixes this issue among other things: https://lore.kernel.org/all/20260221-fp202-v1-0-4d28cb8b28fb@gmail.com/ I've reviewed it but I don't think it's made it into char-misc yet. Felix, maybe you could resend your series? Thanks, -- Romain Gantois, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --nextPart2405237.ElGaqSPkdT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEIcCsAScRrtr7W0x0KCYAIARzeA4FAmnA+NwACgkQKCYAIARz eA5M9g//WXHGdTqM5+f5KaPYu4uGreW6GYlJvqFpvOPs2cgYJ98pQzfAdBnj2KdU bUOJ8JMjo506dcNAP67jtvzQRVnMMi2Wy0DuzMfQ31pc6dmCN2UM1Zz2IGR8CoVp TLW2e6o9m4u3VCD92vwuQv6R56W1w9AbvMxi1Ku3MQl3l4gRbC+xXcXxU920pQTG /yptCPl2yOV+Di4nu7HNfQ821+9bdmDWsxERxXdpuK2VFXNXKe3OfhEXZ8chc2Xb 5W9GYLSu/a+5v0MIuHxFsIPyI2bgIVWLSuw6uuvDDNICC1u+m1TgSfishlO7ud8Y ygSWAp50/nVoc7t7eeV22AMAnVZvXRAgIC1OWI5aVww9gDwTvS/4Zw1A3f2LP+Sx XcxtrT+WBS53PxSjTBt808qRFWH7v1DDTclvGWIhC9S6XRXVh6u0H2m3Ck/7fn7T ms0LCLJ6WdGMChScKAC3Q0fqUSpo9AgTFyajHOu77COFJS2zwPiffNhiAx49Rrln 4SzGYafSfsaEN1nobBbdGJGddhkDIbFw8wJFRW+7sC6559QQWXB+RDWKA3dX1J2X 49LOpUrxSshumVsAeEdtx8G7lzTt+x3IIo7TEVwvk5tXHhQuM+R2koV7uw+idzMC /iwNkB2vFkI1R2NChnqJpBDiSmSJ/XsuSkufEtJk6mVjgGiyJGg= =i6MF -----END PGP SIGNATURE----- --nextPart2405237.ElGaqSPkdT--