ALSA: caiaq: fix out-of-bounds read in the Traktor Kontrol S4 input parser
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 15c5ab607045e278ebf4d2ca4aea2250617d50ca · < a5fd3122283bf75c04f6414bf610100beb0565b0| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ALSA: caiaq: fix out-of-bounds read in the Traktor Kontrol S4 input parser
snd_usb_caiaq_tks4_dispatch() decodes the Traktor Kontrol S4 input stream in fixed 16-byte (TKS4_MSGBLOCK_SIZE) message blocks. On every iteration it advances buf and subtracts the block size while looping on "while (len)".
len is urb->actual_length. That value is supplied by the device and is not guaranteed to be a multiple of 16. When a final short block leaves len between 1 and 15, the loop runs once more, reads up to buf[15], and then does "len -= TKS4_MSGBLOCK_SIZE". As len is unsigned this underflows to a huge value. The loop then keeps iterating and walking buf far past the end of the 512-byte ep4_in_buf, reading out of bounds until a bogus block id happens to be hit.
Iterate only while a full message block is available. This stops the unsigned underflow and silently drops any trailing partial block, which carries no complete control value anyway.
The sibling endpoint-4 parsers are not affected. The Traktor Kontrol X1 and Maschine arms in snd_usb_caiaq_ep4_reply_dispatch() floor urb->actual_length before dispatching.
From the CVE record · Linux
The Linux kernel's ALSA caiaq parser for Traktor Kontrol S4 input can read beyond its buffer when a device supplies a message length that is not a multiple of 16 bytes. An attacker who can control that device input can trigger the out-of-bounds read; the input does not specify authentication or other user interaction requirements.
Engineers running Linux kernels with the ALSA caiaq Traktor Kontrol S4 input parser should check their deployments; affected versions are not specified.