android_kernel_motorola_sm6375/sound
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Takashi Iwai a632bdcb35 ALSA: usb-audio: Fix out of bounds reads when finding clock sources
commit a3dd4d63eeb452cfb064a13862fb376ab108f6a6 upstream.

The current USB-audio driver code doesn't check bLength of each
descriptor at traversing for clock descriptors.  That is, when a
device provides a bogus descriptor with a shorter bLength, the driver
might hit out-of-bounds reads.

For addressing it, this patch adds sanity checks to the validator
functions for the clock descriptor traversal.  When the descriptor
length is shorter than expected, it's skipped in the loop.

For the clock source and clock multiplier descriptors, we can just
check bLength against the sizeof() of each descriptor type.
OTOH, the clock selector descriptor of UAC2 and UAC3 has an array
of bNrInPins elements and two more fields at its tail, hence those
have to be checked in addition to the sizeof() check.

Reported-by: Benoît Sevens <bsevens@google.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/20241121140613.3651-1-bsevens@google.com
Link: https://patch.msgid.link/20241125144629.20757-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Benoît Sevens <bsevens@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-14 19:44:56 +01:00
..
ac97
aoa
arm
atmel
core ALSA: core: add isascii() check to card ID generator 2024-11-08 16:20:40 +01:00
drivers treewide: Replace DECLARE_TASKLET() with DECLARE_TASKLET_OLD() 2023-04-20 12:07:32 +02:00
firewire ALSA: firewire-lib: fix return value on fail in amdtp_tscm_init() 2024-11-17 14:58:50 +01:00
hda ALSA: hda: Add input value sanity checks to HDMI channel map controls 2024-09-12 11:03:51 +02:00
i2c ALSA: i2c/cs8427: fix iec958 mixer control deactivation 2023-04-20 12:07:35 +02:00
isa treewide: Remove uninitialized_var() usage 2023-06-09 10:29:01 +02:00
mips
oss
parisc
pci ALSA: hda/realtek: Apply quirk for Medion E15433 2024-12-14 19:44:38 +01:00
pcmcia
ppc
sh ALSA: sh: aica: reorder cleanup operations to avoid UAF bugs 2024-04-13 12:51:32 +02:00
soc ASoC: hdmi-codec: reorder channel allocation list 2024-12-14 19:44:53 +01:00
sparc
spi
synth ALSA: emux: improve patch ioctl data validation 2024-07-05 09:08:28 +02:00
usb ALSA: usb-audio: Fix out of bounds reads when finding clock sources 2024-12-14 19:44:56 +01:00
x86
xen
ac97_bus.c
Kconfig sound: Make CONFIG_SND depend on INDIRECT_IOMEM instead of UML 2024-11-17 14:58:53 +01:00
last.c
Makefile
sound_core.c