]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: hda: Fix potential access overflow in beep helper
authorTakashi Iwai <tiwai@suse.de>
Tue, 7 Apr 2020 08:44:01 +0000 (10:44 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Apr 2020 08:50:07 +0000 (10:50 +0200)
commit5673adecd7812fc337757ce2a82637645a57e6ef
tree591e5ef3cbd4b548d4b8c82b016b32ab251bfb75
parent5fa52ea7cfda6bdaeebef6f2b65b847533aa832a
ALSA: hda: Fix potential access overflow in beep helper

commit 3d0683ce831bcb479cbc7c17e454c01e42b4771f upstream.

The beep control helper function blindly stores the values in two
stereo channels no matter whether the actual control is mono or
stereo.  This is practically harmless, but it annoys the recently
introduced sanity check, resulting in an error when the checker is
enabled.

This patch corrects the behavior to store only on the defined array
member.

Fixes: 070aaf84ecda ("ALSA: hda - Move beep helper functions to hda_beep.c")
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207139
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200407084402.25589-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/pci/hda/hda_beep.c