android_kernel_oneplus_msm8998/sound/usb
Hui Peng 82fa3e9543 ALSA: usb-audio: Fix UAF decrement if card has no live interfaces in card.c
commit 5f8cf712582617d523120df67d392059eaf2fc4b upstream.

If a USB sound card reports 0 interfaces, an error condition is triggered
and the function usb_audio_probe errors out. In the error path, there was a
use-after-free vulnerability where the memory object of the card was first
freed, followed by a decrement of the number of active chips. Moving the
decrement above the atomic_dec fixes the UAF.

[ The original problem was introduced in 3.1 kernel, while it was
  developed in a different form.  The Fixes tag below indicates the
  original commit but it doesn't mean that the patch is applicable
  cleanly. -- tiwai ]

Fixes: 362e4e49ab ("ALSA: usb-audio - clear chip->probing on error exit")
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: Mathias Payer <mathias.payer@nebelwelt.net>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13 09:21:36 +01:00
..
6fire
bcd2000 ALSA: bcd2000: Make local data static 2015-05-26 13:00:01 +02:00
caiaq ALSA: caiaq: Fix stray URB at probe error path 2017-10-18 09:20:42 +02:00
hiface ALSA: hiface: Fix M2Tech hiFace driver sampling rate change 2017-01-06 11:16:08 +01:00
line6 ALSA: line6: Use correct endpoint type for midi output 2018-04-24 09:32:10 +02:00
misc
usx2y ALSA: usx2y: Suppress kernel warning at page allocation failures 2017-10-12 11:27:32 +02:00
card.c ALSA: usb-audio: Fix UAF decrement if card has no live interfaces in card.c 2018-12-13 09:21:36 +01:00
card.h ALSA: USB-audio: Add quirk for Zoom R16/24 playback 2015-10-19 12:38:09 +02:00
clock.c ALSA: usb-audio: Add sanity checks in v2 clock parsers 2017-11-30 08:37:22 +00:00
clock.h
debug.h
endpoint.c ALSA: usb-audio: test EP_FLAG_RUNNING at urb completion 2017-08-06 19:19:47 -07:00
endpoint.h ALSA: usb-audio: Fix irq/process data synchronization 2017-01-12 11:22:43 +01:00
format.c ALSA: usb-audio: Fix audio output on Roland SC-D70 sound module 2015-04-21 07:59:10 +02:00
format.h
helper.c
helper.h
Kconfig
Makefile
midi.c ALSA: usb-audio: avoid freeing umidi object twice 2016-02-17 12:30:58 -08:00
midi.h
mixer.c ALSA: usb: mixer: volume quirk for CM102-A+/102S+ 2018-05-26 08:48:52 +02:00
mixer.h ALSA: usb-audio: Kill stray URB at exiting 2017-10-18 09:20:42 +02:00
mixer_maps.c ALSA: usb-audio: Skip broken EU on Dell dock USB-audio 2018-05-02 07:53:40 -07:00
mixer_quirks.c ALSA: usb-audio: Add mute TLV for playback volumes on C-Media devices 2017-08-24 17:02:35 -07:00
mixer_quirks.h ALSA: usb-audio: Add a more accurate volume quirk for AudioQuest DragonFly 2015-12-14 10:13:17 +01:00
mixer_scarlett.c
mixer_scarlett.h
pcm.c ALSA: usb-audio: Apply rate limit to warning messages in URB complete callback 2018-08-06 16:24:35 +02:00
pcm.h
power.h
proc.c ALSA: usb-audio: Avoid nested autoresume calls 2015-08-26 15:38:25 +02:00
proc.h
quirks-table.h ALSA: usb-audio: Fix multiple definitions in AU0828_DEVICE() macro 2018-09-26 08:35:04 +02:00
quirks.c ALSA: usb-audio: Add native DSD support for Pro-Ject Pre Box S2 Digital 2017-10-27 10:23:16 +02:00
quirks.h
stream.c ALSA: usb-audio: Fix double-free in error paths after snd_usb_add_audio_stream() call 2016-04-12 09:08:44 -07:00
stream.h
usbaudio.h ALSA: usb-audio: prevent CH345 multiport output SysEx corruption 2015-11-16 08:59:24 +01:00