mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-07-25 16:19:48 +02:00
ALSA: asihpi: Fix potential OOB array access at reading cache
commit 7b7d657214 upstream.
find_control() to retrieve a cached info accesses the array with the
given index blindly, which may lead to an OOB array access.
Add a sanity check for avoiding it.
Link: https://sashiko.dev/#/patchset/20260511230121.28606-1-rosenp%40gmail.com
Cc: <stable@vger.kernel.org>
Link: https://patch.msgid.link/20260515085606.242284-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
786ff77a92
commit
ffa29cea7b
@@ -276,6 +276,12 @@ static short find_control(u16 control_index,
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (control_index >= p_cache->control_count) {
|
||||
HPI_DEBUG_LOG(VERBOSE, "control_index out of bounce %d\n",
|
||||
control_index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*pI = p_cache->p_info[control_index];
|
||||
if (!*pI) {
|
||||
HPI_DEBUG_LOG(VERBOSE, "Uncached Control %d\n",
|
||||
|
||||
Reference in New Issue
Block a user