android_kernel_samsung_msm8226/sound
Hui Peng e211a68fc9 ALSA: usb-audio: Fix an OOB bug in parse_audio_mixer_unit
commit daac07156b330b18eb5071aec4b3ddca1c377f2c upstream.

The `uac_mixer_unit_descriptor` shown as below is read from the
device side. In `parse_audio_mixer_unit`, `baSourceID` field is
accessed from index 0 to `bNrInPins` - 1, the current implementation
assumes that descriptor is always valid (the length  of descriptor
is no shorter than 5 + `bNrInPins`). If a descriptor read from
the device side is invalid, it may trigger out-of-bound memory
access.

```
struct uac_mixer_unit_descriptor {
	__u8 bLength;
	__u8 bDescriptorType;
	__u8 bDescriptorSubtype;
	__u8 bUnitID;
	__u8 bNrInPins;
	__u8 baSourceID[];
}
```

This patch fixes the bug by add a sanity check on the length of
the descriptor.

Reported-by: Hui Peng <benquike@gmail.com>
Reported-by: Mathias Payer <mathias.payer@nebelwelt.net>
Signed-off-by: Hui Peng <benquike@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
CVE-2019-15117
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
Change-Id: I4173c102a7f0752d8113823f5070ccb7de5f8914
2020-04-18 17:55:14 +02:00
..
aoa
arm Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
atmel
core ALSA: pcm : Call kill_fasync() in stream lock 2019-08-06 12:24:26 +02:00
drivers Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
firewire
i2c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
isa Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
mips
oss Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
parisc
pci Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
pcmcia
ppc
sh
soc dsp: q6voice: Check size of shared memory buffer before access 2020-01-06 08:40:50 +01:00
sparc
spi
synth Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
usb ALSA: usb-audio: Fix an OOB bug in parse_audio_mixer_unit 2020-04-18 17:55:14 +02:00
Kconfig
Makefile
ac97_bus.c
last.c
sound_core.c
sound_firmware.c