ALSA: usb-audio: Fix DMA buffer out-of-bounds write when fill_max is set
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8fdff6a319e7dac757c558bd283dc4577e68cde7 · < 04595233e5606d452f9f47e6989fc7ae7440fd40| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ALSA: usb-audio: Fix DMA buffer out-of-bounds write when fill_max is set
When a USB audio endpoint requests full packet transfers via the fill_max descriptor flag, data_ep_set_params() promotes ep->curpacksize to ep->maxpacksize. However, maxsize is left at the original sample-rate derived value.
Since u->buffer_size is allocated as maxsize * packets, the resulting DMA buffer is far too small for the requested transfer length. When the USB host controller streams up to curpacksize bytes per packet, it writes past the end of the buffer via DMA, corrupting kernel heap memory.
Update maxsize to curpacksize when fill_max is set so that the allocated DMA buffer size matches the actual transfer request size.
[ changed to reassign maxsize only when ep->fill_max is set -- tiwai ]
From the CVE record · Linux
The Linux kernel’s ALSA USB audio driver can allocate a DMA buffer that is too small when a USB audio endpoint sets the fill_max flag. Transfers can then write beyond the buffer and corrupt kernel heap memory. The input does not specify authentication requirements or whether user interaction is needed.
Engineers running Linux kernels with the affected ALSA USB audio code should check their installations; affected versions are not specified.