Re: [PATCH 6.6 & 5.10] usb: typec: ucsi: validate connector number in ucsi_connector_change
From: Hongbo Li
Date: Fri May 08 2026 - 08:59:34 EST
Hi Greg,
On 2026/5/8 19:03, Greg KH wrote:
On Fri, May 08, 2026 at 05:20:26PM +0800, Hongbo Li wrote:
Commit d2d8c17ac01a ("usb: typec: ucsi: validate connector
number in ucsi_notify_common()") and commit 5a1140404cbf ("usb:
typec: ucsi: skip connector validation before init") add the bounds
check when do the connector change both in pre-init notification and
the forward notifications. But they are difficult to backport to
early stable branch such as LTS 6.6, LTS 5.10 due to many dependencies.
Instead, we choose to validate connector number in ucsi_connector_change
directly to avoid out-of-range issue.
Why just these 2 branches?
I only noticed these two branches, but in fact, there are more.
And what specific commits are needed exactly? Why not just backport
them all? that will make future changes apply properly as well, making
Commit d2d8c17ac01a ("usb: typec: ucsi: validate connector number in ucsi_notify_common()") use the ucsi_notify_common helper which is introduced in 584e8df58942 ("usb: typec: ucsi: extract common code for command handling"). This commit refactored part of the code and involves many modifications to USB ucsi controllers (such as stm32g0...), which were introduced after 6.6.
I think there are two possible modifications:
One is to adapt the modification for different branches, and the other is to modify the code in ucsi_connector_change (as in my commit).
Thanks,
Hongbo
the overall work much less over time.
thanks,
greg k-h