android_kernel_samsung_msm8976/sound
Takashi Iwai 549584e9e1 ALSA: seq: Fix double port list deletion
commit 13d5e5d4725c64ec06040d636832e78453f477b7 upstream.

The commit [7f0973e973cd: ALSA: seq: Fix lockdep warnings due to
double mutex locks] split the management of two linked lists (source
and destination) into two individual calls for avoiding the AB/BA
deadlock.  However, this may leave the possible double deletion of one
of two lists when the counterpart is being deleted concurrently.
It ends up with a list corruption, as revealed by syzkaller fuzzer.

This patch fixes it by checking the list emptiness and skipping the
deletion and the following process.

BugLink: http://lkml.kernel.org/r/CACT4Y+bay9qsrz6dQu31EcGaH9XwfW7o3oBzSQUG9fMszoh=Sg@mail.gmail.com
Fixes: 7f0973e973cd ('ALSA: seq: Fix lockdep warnings due to 'double mutex locks)
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25 11:57:46 -08:00
..
aoa ALSA: snd-aoa: Add a layout entry for PowerBook6,5 2013-05-16 07:19:01 +02:00
arm ASoC: fix broken pxa SoC support 2015-10-22 14:37:50 -07:00
atmel ALSA: atmel: Remove redundant platform_set_drvdata() 2013-05-03 11:40:23 +02:00
core ALSA: seq: Fix double port list deletion 2016-02-25 11:57:46 -08:00
drivers ALSA: dummy: Implement timer backend switching more safely 2016-02-19 14:22:40 -08:00
firewire
i2c ALSA: ak411x: Fix stall in work callback 2015-02-11 14:48:17 +08:00
isa ALSA: msnd: Avoid duplicated driver name 2013-11-29 11:11:45 -08:00
mips ALSA: mips/sgio2audio: Remove redundant platform_set_drvdata() 2013-05-06 10:45:54 +02:00
oss sound/oss: fix deadlock in sequencer_ioctl(SNDCTL_SEQ_OUTOFBAND) 2015-05-17 09:51:33 -07:00
parisc
pci ALSA: hda - Fix speaker output from VAIO AiO machines 2016-02-19 14:22:40 -08:00
pcmcia
ppc
sh
soc ASoC: dpcm: fix the BE state on hw_free 2016-02-19 14:22:39 -08:00
sparc
spi
synth ALSA: synth: Fix conflicting OSS device registration on AWE32 2015-10-22 14:37:50 -07:00
usb ALSA: usb-audio: avoid freeing umidi object twice 2016-02-19 14:22:39 -08:00
Kconfig
Makefile
ac97_bus.c
last.c
sound_core.c
sound_firmware.c