CVE-2026-138843: usb: typec: ucsi: ccg: Validate altmode index in GET_CURRENT_CAM response
In the Linux kernel, the following vulnerability has been resolved:
usb: typec: ucsi: ccg: Validate altmode index in GETCURRENTCAM response
When the PPM reports more than one DisplayPort alternate mode for a connector, ucsiccgupdatealtmodes() merges them into a single entry in uc->updated[] and sets uc->hasmultipledp. In that case, ucsiccgupdategetcurrentcamcmd() rewrites the response of the GETCURRENTCAM command. The response is a single byte holding the index of the currently active alternate mode, and it is provided by the PPM firmware.
The function uses this byte directly as an index into uc->orig[], and then uses the linkedidx read from that entry as the translated index into uc->updated[]. Both arrays have UCSIMAXALTMODES entries, but neither index is checked against that size.
If a malicious or buggy PPM reports a value of UCSIMAXALTMODES or larger, e.g. 0xFF, uc->orig[cam].linkedidx reads over the end of uc->orig[]. The byte read from there is then used as the index for writing cam into uc->updated[newcam].activeidx, so the out-of-bounds read is followed by an out-of-bounds write. This happens without any userspace action, since the UCSI core issues GETCURRENTCAM on its own when handling connector changes.
Fix this by rejecting responses whose index is out of range, printing an error and returning -EPROTO, so that the caller cannot accept this. Also check linkedidx before using it as an index, so that the write into uc->updated[] is always within bounds.
The response is now only processed when the command completed without an error. ucsisynccontrolcommon() only reads the response when the CCI reports command completion, so otherwise the buffer is not filled and must not be mistaken for an invalid index.
This bug was found with a Python script that traces where firmware input is used.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.10.275 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 5.15.226 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.1.193 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.6.163 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.118 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.18.63 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 7.3.4 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.118-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 7.3.4-1 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.118-1Fixed in 7.3.4-1 - Compensating control
In the Linux kernel UCSI CCG GET_CURRENT_CAM response handling, validate the reported alternate-mode index before using it to access uc->orig[] or write to uc->updated[]; reject indexes greater than or equal to UCSI_MAX_ALTMODES with -EPROTO, and process the response only when the command completed without error.
Event History
Frequently Asked Questions
What systems are exposed to this issue?
Systems using the Linux kernel UCSI CCG path are affected when a connector has more than one DisplayPort alternate mode reported by the PPM. The issue is triggered if that PPM reports an invalid current alternate-mode index of UCSI_MAX_ALTMODES or greater.
What does an attacker or faulty component need to do to trigger it?
A malicious or buggy PPM firmware must return an out-of-range byte in the GET_CURRENT_CAM response, such as 0xFF. This causes an out-of-bounds read from uc->orig[] followed by an out-of-bounds write to uc->updated[]
Is user interaction required?
No. The UCSI core issues the GET_CURRENT_CAM command without userspace action, so the invalid firmware response can trigger the condition automatically.