ALSA: FCP: fix OOB write in fcp_meter_ctl_get()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.457.1.97.2In the Linux kernel, the following vulnerability has been resolved:
ALSA: FCP: fix OOB write in fcp_meter_ctl_get()
fcp_ioctl_set_meter_map() bounds the user-supplied Level Meter map size by the driver's own limit of 255
if (map.map_size < 1 || map.map_size > 255 || map.meter_slots < 1 || map.meter_slots > 255) return -EINVAL;
and passes it to fcp_add_new_ctl() as the control's channel count, where it is stored as elem->channels.
Every control read writes into struct snd_ctl_elem_value, whose integer array is declared long value[128], so the limit is 128, not 255. fcp_meter_ctl_get() stores one 64-bit word per channel into that array with no bound of its own:
for (i = 0; i < elem->channels; i++) { int idx = private->meter_level_map[i]; int value = idx < 0 ? 0 : le32_to_cpu(resp[idx]);
ucontrol->value.integer.value[i] = value; }
From the CVE record · Linux
The ALSA FCP driver accepts a Level Meter map larger than the control-read value array, causing an out-of-bounds write during a control read. Installing the oversized map requires CAP_SYS_RAWIO, but afterward any process able to read controls on /dev/snd/controlC0 can trigger the write.
Engineers running Linux kernels with the ALSA FCP driver should check their systems; affected versions are not specified.