ALSA: scarlett2: Fix buffer overflow in config retrieval
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ ac34df733d2dfe3b553897a1e9e1a44414f09834 · < 6f5c69f72e50d51be3a8c028ae7eda42c82902cb| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
ALSA: scarlett2: Fix buffer overflow in config retrieval
The scarlett2_usb_get_config() function has a logic error in the endianness conversion code that can cause buffer overflows when count > 1.
The code checks `if (size == 2)` where `size` is the total buffer size in bytes, then loops `count` times treating each element as u16 (2 bytes). This causes the loop to access `count * 2` bytes when the buffer only has `size` bytes allocated.
Fix by checking the element size (config_item->size) instead of the total buffer size. This ensures the endianness conversion matches the actual element type.
From the CVE record · Linux
The Linux kernel’s ALSA scarlett2 config retrieval has a logic error that can cause a buffer overflow when the item count is greater than one. The input does not specify how an attacker could trigger it or whether access or user interaction is required.
Engineers running Linux kernels with the ALSA scarlett2 driver should check their installations; affected versions are not specified.