USB: serial: option: fix slab OOB read in interrupt URB callback
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 58cfe9113e485f7e04bd0eac4fc4251b330af501 · < 2ef5560387f2c0713cee975be2b24b281bd90f3e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
USB: serial: option: fix slab OOB read in interrupt URB callback
The interrupt URB buffer is allocated in setup_port_interrupt_in() based on the endpoint's wMaxPacketSize:
buffer_size = usb_endpoint_maxp(epd); port->interrupt_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
When a USB device declares wMaxPacketSize = 8 on its interrupt IN endpoint, the buffer is allocated from kmalloc-8 cache (exactly 8 bytes).
If the device sends a short packet (actual_length < wMaxPacketSize), the URB completes with status == 0 and the callback proceeds to read:
data[sizeof(struct usb_ctrlrequest)]
which evaluates to data[8], accessing 1 byte beyond the allocated 8-byte buffer. This results in a slab out-of-bounds read.
From the CVE record · Linux
The Linux kernel USB serial option driver can read beyond its interrupt buffer when a USB device declares an 8-byte interrupt endpoint and sends a short packet. A device that triggers these conditions can cause a slab out-of-bounds read; this requires the device to be connected, and no authentication requirement is described.
Operators of Linux systems using the USB serial option driver should check their kernel versions; affected versions are not specified.