diff options
| author | Samasth Norway Ananda <samasth.norway.ananda@oracle.com> | 2026-01-16 17:27:06 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-01-30 10:32:23 +0100 |
| commit | 31a3eba5c265a763260976674a22851e83128f6d (patch) | |
| tree | 57c490e1b4024e678a58f6975f0dbdfa8524a5a7 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 29f43e8ec7bf017303751a3b0180a8b22d25b3b1 (diff) | |
ALSA: scarlett2: Fix buffer overflow in config retrieval
commit 6f5c69f72e50d51be3a8c028ae7eda42c82902cb upstream.
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.
Fixes: ac34df733d2d ("ALSA: usb-audio: scarlett2: Update get_config to do endian conversion")
Cc: stable@vger.kernel.org
Signed-off-by: Samasth Norway Ananda <samasth.norway.ananda@oracle.com>
Link: https://patch.msgid.link/20260117012706.1715574-1-samasth.norway.ananda@oracle.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
