ALSA: usb-audio: fix OOB write in snd_usbmidi_us122l_output()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 030a07e441296c372f946cd4065b5d831d8dc40c · < 9392a2c346762ffee8edd1ba8bac50d2e24a2ed7| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ALSA: usb-audio: fix OOB write in snd_usbmidi_us122l_output()
The snd_usbmidi_us122l_output() picks a count of 2 on anything slower than high speed and never relates it to ep->max_transfer. The URB buffer holds exactly max_transfer bytes, so a device declaring a one byte bulk endpoint takes two bytes from snd_rawmidi_transmit(), and the memset that pads the rest computes 1 - 2 in int and wraps to SIZE_MAX.
Only 0x800e and 0x800f are pinned to nine bytes. The US-122MKII at 0x0644:0x8021 falls to the default and takes usb_maxpacket(), which the USB core only clamps downward.
The akai and novation output ops in this file were given the same guard recently. Do the same here.
From the CVE record · Linux
The Linux kernel’s ALSA USB MIDI output function can write beyond its transfer buffer when a connected USB device declares a one-byte bulk endpoint and runs slower than high speed. The function attempts to transmit two bytes, and its padding calculation can wrap to a very large value.
Engineers running the Linux kernel with ALSA USB audio support should check their kernel versions against the vendor advisory; affected versions were not specified.