summaryrefslogtreecommitdiff
path: root/scripts/basic
diff options
context:
space:
mode:
authorShipei Qu <qu@darknavy.com>2025-12-17 10:46:30 +0800
committerTakashi Iwai <tiwai@suse.de>2025-12-17 10:02:22 +0100
commit5526c1c6ba1d0913c7dfcbbd6fe1744ea7c55f1e (patch)
tree0e0377786d9737f7274e59e77f54a3f102d0e7b8 /scripts/basic
parent5032347c04ba7ff9ba878f262e075d745c06a2a8 (diff)
ALSA: usb-mixer: us16x08: validate meter packet indices
get_meter_levels_from_urb() parses the 64-byte meter packets sent by the device and fills the per-channel arrays meter_level[], comp_level[] and master_level[] in struct snd_us16x08_meter_store. Currently the function derives the channel index directly from the meter packet (MUB2(meter_urb, s) - 1) and uses it to index those arrays without validating the range. If the packet contains a negative or out-of-range channel number, the driver may write past the end of these arrays. Introduce a local channel variable and validate it before updating the arrays. We reject negative indices, limit meter_level[] and comp_level[] to SND_US16X08_MAX_CHANNELS, and guard master_level[] updates with ARRAY_SIZE(master_level). Fixes: d2bb390a2081 ("ALSA: usb-audio: Tascam US-16x08 DSP mixer quirk") Reported-by: DARKNAVY (@DarkNavyOrg) <vr@darknavy.com> Closes: https://lore.kernel.org/tencent_21C112743C44C1A2517FF219@qq.com Signed-off-by: Shipei Qu <qu@darknavy.com> Link: https://patch.msgid.link/20251217024630.59576-1-qu@darknavy.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions