android_kernel_samsung_msm8976/sound/usb
Hui Peng 70350d071d 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.

Change-Id: Ifa5b3c5177dd5a3c93e4523516014664313e7523
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>
2020-04-03 21:59:29 +02:00
..
6fire
caiaq
misc
usx2y
Kconfig
Makefile
card.c ALSA: usb-audio: Fix UAF decrement if card has no live interfaces in card.c 2019-10-19 23:31:29 +02:00
card.h
clock.c ALSA: usb-audio: Add sanity checks in v2 clock parsers 2019-07-27 21:46:06 +02:00
clock.h
debug.h
endpoint.c Merge tag 'LA.BR.1.3.6-03510-8976.0' into HEAD 2017-04-18 12:11:50 +02:00
endpoint.h ALSA: usb-audio: Fix races at disconnection and PCM closing 2015-02-18 11:01:42 -08:00
format.c
format.h
helper.c
helper.h
midi.c This is the 3.10.94 stable release 2017-04-18 17:12:56 +02:00
midi.h
mixer.c ALSA: usb-audio: Fix an OOB bug in parse_audio_mixer_unit 2020-04-03 21:59:29 +02:00
mixer.h ALSA: usb-audio: Kill stray URB at exiting 2018-08-20 12:15:26 +02:00
mixer_maps.c ALSA: usb-audio: add dB range mapping for some devices 2015-08-10 12:20:30 -07:00
mixer_quirks.c ALSA: usb - Creative USB X-Fi Pro SB1095 volume knob support 2015-04-19 10:10:46 +02:00
mixer_quirks.h
pcm.c ALSA: usb-audio: clear SUBSTREAM_FLAG_SYNC_EP_STARTED on error 2019-07-27 22:10:16 +02:00
pcm.h
power.h
proc.c
proc.h
quirks-table.h ALSA: usb-audio: prevent CH345 multiport output SysEx corruption 2015-12-09 13:40:10 -05:00
quirks.c This is the 3.10.97 stable release 2017-04-18 17:17:20 +02:00
quirks.h
stream.c ALSA: usb-audio: Always check descriptor sizes in parser code 2019-07-27 22:10:17 +02:00
stream.h
usbaudio.h ALSA: usb-audio: prevent CH345 multiport output SysEx corruption 2015-12-09 13:40:10 -05:00