linux/sound
Takashi Iwai 4efda5f213 ASoC: Fix use-after-free at card unregistration
soc_cleanup_card_resources() call snd_card_free() at the last of its
procedure.  This turned out to lead to a use-after-free.
PCM runtimes have been already removed via soc_remove_pcm_runtimes(),
while it's dereferenced later in soc_pcm_free() called via
snd_card_free().

The fix is simple: just move the snd_card_free() call to the beginning
of the whole procedure.  This also gives another benefit: it
guarantees that all operations have been shut down before actually
releasing the resources, which was racy until now.

Reported-and-tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: <stable@vger.kernel.org>
2017-05-24 18:11:08 +01:00
..
aoa
arm
atmel
core Merge branch 'for-linus' into for-next 2017-04-14 09:01:04 +02:00
drivers Annotation of module parameters that specify device settings 2017-05-10 19:13:03 -07:00
firewire ALSA: fireface: obsolete usage of ktime_set() for zero assignment 2017-04-20 15:00:54 +02:00
hda ALSA: hda: Fix cpu lockup when stopping the cmd dmas 2017-05-10 08:47:17 +02:00
i2c
isa Annotation of module parameters that specify device settings 2017-05-10 19:13:03 -07:00
mips ALSA: mips: avoid potential uninitialized variable use 2017-01-16 14:33:42 +01:00
oss Annotate hardware config module parameters in sound/oss/ 2017-04-20 12:02:32 +01:00
parisc
pci sound fixes for 4.12-rc1 2017-05-12 12:10:38 -07:00
pcmcia lib/vsprintf.c: remove %Z support 2017-02-27 18:43:47 -08:00
ppc scripts/spelling.txt: add "followings" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
sh ktime: Cleanup ktime_set() usage 2016-12-25 17:21:22 +01:00
soc ASoC: Fix use-after-free at card unregistration 2017-05-24 18:11:08 +01:00
sparc
spi
synth ALSA: emux: stop if copy_from_user() fails 2017-03-31 16:23:52 +02:00
usb ALSA: usb-audio: replace /proc/bus/usb by /dev/bus/usb 2017-04-17 10:23:55 +02:00
x86 alsa: use set_memory.h header 2017-05-08 17:15:14 -07:00
ac97_bus.c
Kconfig sound: Disable the build of OSS drivers 2017-05-12 09:57:20 +02:00
last.c
Makefile ALSA: add Intel HDMI LPE audio driver for BYT/CHT-T 2017-01-25 14:23:46 +01:00
sound_core.c