CVE-2026-139548: platform/chrome: cros_ec_typec: Validate SVID and mode counts in discovery data
In the Linux kernel, the following vulnerability has been resolved:
platform/chrome: crosectypec: Validate SVID and mode counts in discovery data
crostypecregisteraltmodes() iterates over sopdisc->svidcount and sopdisc->svids[i].modecount from the ECCMDTYPECDISCOVERY response without validating their bounds.
port->discdata is allocated as a buffer of ECPROTO2MAXRESPONSESIZE bytes, and each SVID entry contains a fixed modevdo[6] array. If the EC returns an out-of-bounds svidcount or modecount, the loops read past the end of the modevdo array or the discdata buffer.
Validate that the discovery response with svidcount entries fits within ECPROTO2MAXRESPONSESIZE using structsize(), and ensure each SVID's modecount does not exceed ARRAYSIZE(sopdisc->svids[i].modevdo) before registering altmodes.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Before registering altmodes, validate that the discovery response fits within EC_PROTO2_MAX_RESPONSE_SIZE using struct_size(), that svid_count fits within the response buffer, and that each SVID's mode_count does not exceed ARRAY_SIZE(sop_disc->svids[i].mode_vdo).
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using the Linux kernel's Chrome platform Type-C EC driver are exposed when they process USB Type-C discovery data returned by the embedded controller. The issue is in handling discovery responses during alternate-mode registration.
What is required to trigger the out-of-bounds reads?
The embedded controller must return a Type-C discovery response containing an out-of-bounds SVID count or mode count. An excessive SVID count can make parsing extend beyond the allocated discovery-data buffer, while an excessive mode count can read beyond the fixed six-entry mode_vdo array for an SVID.
What validation should a fix add?
The driver should verify that a discovery response containing the reported number of SVID entries fits within EC_PROTO2_MAX_RESPONSE_SIZE using struct_size(). It should also reject or limit each SVID mode_count to the size of that entry's mode_vdo array before registering alternate modes.