CVE-2026-142953: gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes
In the Linux kernel, the following vulnerability has been resolved:
gpio: mpsse: reject bulk-in endpoints smaller than 3 bytes
mpsseread() reads min(len + 2, wMaxPacketSize) bytes and then copies lenactual - 2 bytes to the caller. A device that declares a bulk-in endpoint with wMaxPacketSize 1 completes the read with lenactual 1, so the copy length becomes -1 and memcpy() runs far past the one byte buffer on the caller's stack and past bulkinbuf:
memcpy: detected buffer overflow: 18446744073709551615 byte write of buffer size 1 WARNING: lib/stringhelpers.c:1036 at fortifyreport+0x6e/0xc0 Call Trace: fortifypanic+0xd/0x10 gpiompssegetmultiple+0x767/0x780 gpiompssegpioget+0xa2/0xf0 gpiodgetrawvaluecommit+0xf8/0x1f0 gpiodgetvaluecansleep+0x1e/0xa0 valueshow+0x42/0x90
Reproduced with dummyhcd and raw-gadget. A read needs room for the two status bytes plus at least one data byte, so refuse to bind otherwise.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Make gpio-mpsse reject bulk-in endpoints with wMaxPacketSize smaller than 3 bytes; refuse to bind to those endpoints.
Event History
Frequently Asked Questions
What must an attacker control to trigger the overflow?
An attacker needs a device that the mpsse GPIO driver binds to and that declares a bulk-in endpoint with a wMaxPacketSize of 1. When the driver performs a read, a one-byte completion causes the calculated copy length to underflow.
Which systems are exposed?
Linux systems are exposed when they use the mpsse GPIO driver with a device whose bulk-in endpoint is smaller than 3 bytes. The vulnerable read path is reached when GPIO values are read from that device.
What can be done before the fix is available?
Do not allow the mpsse driver to bind to devices declaring a bulk-in endpoint smaller than 3 bytes. The resolved behavior is to refuse binding because reads require two status bytes and at least one data byte.
How can I recognize an attempted or successful trigger?
The kernel may report a fortified memcpy buffer overflow with a copy size of 18446744073709551615. Relevant stack frames include gpio_mpsse_get_multiple, gpio_mpsse_gpio_get, and gpiod_get_value_cansleep.