ALSA: usb-audio: fix OOB write on Type II inbound URBs
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 8fdff6a319e7dac757c558bd283dc4577e68cde7 · < 0a235379825e1a6194e43861ee6658e5fc35686d| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ALSA: usb-audio: fix OOB write on Type II inbound URBs
data_ep_set_params() sizes each URB transfer buffer before it adds the Format Type II transfer delimiter:
u->packets = urb_packs; u->buffer_size = maxsize * u->packets;
if (fmt->fmt_type == UAC_FORMAT_TYPE_II) u->packets++; /* for transfer delimiter */ u->urb = usb_alloc_urb(u->packets, GFP_KERNEL);
buffer_size is computed from the pre-increment packet count and never recomputed, so for a Type II endpoint the buffer is one packet short of the packet count the URB is built with.
prepare_inbound_urb() then lays out one iso frame per packet and never consults buffer_size:
offs = 0; for (i = 0; i < urb_ctx->packets; i++) { urb->iso_frame_desc[i].offset = offs; urb->iso_frame_desc[i].length = ep->curpacksize; offs += ep->curpacksize; }
From the CVE record · Linux
The ALSA USB-audio driver allocates a transfer buffer that is one packet too small for Type II capture streams. A USB device advertising a Type II capture format can cause an out-of-bounds write on inbound transfers after local userspace sets the stream's hw_params; the input does not specify authentication requirements.
Engineers running the Linux kernel with USB-audio capture devices should check for affected versions; no version range is provided.