1
0
Fork 0
remarkable-linux/sound/usb
Vladis Dronov 03e046efdb ALSA: usb-audio: Fix double-free in error paths after snd_usb_add_audio_stream() call
[ Upstream commit 836b34a935 ]

create_fixed_stream_quirk(), snd_usb_parse_audio_interface() and
create_uaxx_quirk() functions allocate the audioformat object by themselves
and free it upon error before returning. However, once the object is linked
to a stream, it's freed again in snd_usb_audio_pcm_free(), thus it'll be
double-freed, eventually resulting in a memory corruption.

This patch fixes these failures in the error paths by unlinking the audioformat
object before freeing it.

Based on a patch by Takashi Iwai <tiwai@suse.de>

[Note for stable backports:
 this patch requires the commit 902eb7fd1e ('ALSA: usb-audio: Minor
 code cleanup in create_fixed_stream_quirk()')]

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1283358
Reported-by: Ralf Spenneberg <ralf@spenneberg.net>
Cc: <stable@vger.kernel.org> # see the note above
Signed-off-by: Vladis Dronov <vdronov@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2016-07-10 23:06:55 -04:00
..
6fire ALSA: 6fire: Convert byte_rev_table uses to bitrev8 2014-11-14 08:01:53 +01:00
bcd2000 ALSA: MIDI driver for Behringer BCD2000 USB device 2014-04-07 16:05:41 +02:00
caiaq ALSA: snd-usb-caiaq: fix stream count check 2015-01-05 08:56:19 +01:00
hiface ALSA: usb: Convert to snd_card_new() with a device pointer 2014-02-12 11:18:00 +01:00
line6 ALSA: line6: Fix -EBUSY error during active monitoring 2015-08-10 12:21:53 -07:00
misc ALSA: pcm: Add snd_pcm_stop_xrun() helper 2014-11-09 18:20:40 +01:00
usx2y ALSA: usx2y: Move UAPI definition into include/uapi/sound/usb_stream.h 2015-01-28 17:33:49 +01:00
Kconfig ALSA: move line6 usb driver into sound/usb 2015-01-12 22:29:57 +01:00
Makefile ALSA: line6: Split to each driver 2015-01-20 08:14:17 +01:00
card.c ALSA: usb-audio: Avoid calling usb_autopm_put_interface() at disconnect 2016-04-06 10:58:39 -04:00
card.h ALSA: usb: update trigger timestamp on first non-zero URB submitted 2015-02-09 16:02:43 +01:00
clock.c ALSA: usb-audio: Add sanity checks for endpoint accesses 2016-04-18 08:50:59 -04:00
clock.h ALSA: usb-audio: UAC2: do clock validity check earlier 2013-04-04 08:30:59 +02:00
debug.h ALSA: usb-audio: make hwc_debug a noop in case HW_CONST_DEBUG is not set 2011-05-18 11:44:35 +02:00
endpoint.c ALSA: usb-audio: Add sanity checks for endpoint accesses 2016-04-18 08:50:59 -04:00
endpoint.h ALSA: usb-audio: Pass direct struct pointer instead of list_head 2014-11-04 15:09:10 +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 ALSA: usb-audio: store protocol version in struct audioformat 2013-06-27 21:59:47 +02:00
helper.c ALSA: usb-audio: support wireless devices in snd_usb_parse_datainterval 2013-10-07 12:52:21 +02:00
helper.h ALSA: usb-audio: increase control transfer timeout 2011-09-27 09:21:48 +02:00
midi.c ALSA: usb-audio: avoid freeing umidi object twice 2016-03-04 10:25:43 -05:00
midi.h ALSA: usb-audio: Whitespace cleanups for sound/usb/midi.* 2014-08-05 20:08:00 +02:00
mixer.c ALSA: usb-audio: Avoid nested autoresume calls 2016-04-06 10:56:35 -04:00
mixer.h ALSA: usb-audio: Fix parameter block size for UAC2 control requests 2016-04-06 10:56:30 -04:00
mixer_maps.c ALSA: usb-audio: Skip volume controls triggers hangup on Dell USB Dock 2016-04-20 01:08:55 -04:00
mixer_quirks.c ALSA: usb-audio: Add sanity checks for endpoint accesses 2016-04-18 08:50:59 -04:00
mixer_quirks.h ALSA: usb-audio: Add a more accurate volume quirk for AudioQuest DragonFly 2016-01-31 11:23:33 -08:00
mixer_scarlett.c ALSA: usb-audio: Fix Scarlett 6i6 initialization typo 2014-12-18 08:39:17 +01:00
mixer_scarlett.h ALSA: usb-audio: Scarlett mixer interface for 6i6, 18i6, 18i8 and 18i20 2014-11-13 07:32:39 +01:00
pcm.c ALSA: usb-audio: Add sanity checks for endpoint accesses 2016-04-18 08:50:59 -04:00
pcm.h ALSA: usb: refine delay information with USB frame counter 2011-09-12 10:30:20 +02:00
power.h ALSA: usbaudio: implement USB autosuspend 2011-03-11 14:59:29 +01:00
proc.c ALSA: usb-audio: Avoid nested autoresume calls 2016-04-06 10:56:35 -04:00
proc.h ALSA: usb-audio: refactor code 2010-03-05 08:17:14 +01:00
quirks-table.h ALSA: usb-audio: prevent CH345 multiport output SysEx corruption 2015-12-09 14:03:27 -05:00
quirks.c ALSA: usb-audio: Fix double-free in error paths after snd_usb_add_audio_stream() call 2016-07-10 23:06:55 -04:00
quirks.h ALSA: usb-audio: Don't attempt to get Lifecam HD-5000 sample rate 2015-02-17 07:20:04 +01:00
stream.c ALSA: usb-audio: Fix double-free in error paths after snd_usb_add_audio_stream() call 2016-07-10 23:06:55 -04:00
stream.h ALSA: snd-usb: re-order code 2011-09-14 17:07:02 +02:00
usbaudio.h ALSA: usb-audio: Avoid nested autoresume calls 2016-04-06 10:56:35 -04:00