android_kernel_samsung_msm8976/sound
Takashi Iwai 9ceaf90379 ALSA: pcm : Call kill_fasync() in stream lock
commit 3aa02cb664c5fb1042958c8d1aa8c35055a2ebc4 upstream.

Currently kill_fasync() is called outside the stream lock in
snd_pcm_period_elapsed().  This is potentially racy, since the stream
may get released even during the irq handler is running.  Although
snd_pcm_release_substream() calls snd_pcm_drop(), this doesn't
guarantee that the irq handler finishes, thus the kill_fasync() call
outside the stream spin lock may be invoked after the substream is
detached, as recently reported by KASAN.

As a quick workaround, move kill_fasync() call inside the stream
lock.  The fasync is rarely used interface, so this shouldn't have a
big impact from the performance POV.

Ideally, we should implement some sync mechanism for the proper finish
of stream and irq handler.  But this oneliner should suffice for most
cases, so far.

Reported-by: Baozeng Ding <sploving1@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
2017-04-22 23:02:55 +02:00
..
aoa
arm ASoC: fix broken pxa SoC support 2015-10-22 14:37:50 -07:00
atmel
core ALSA: pcm : Call kill_fasync() in stream lock 2017-04-22 23:02:55 +02:00
drivers ALSA: dummy: Implement timer backend switching more safely 2016-02-19 14:22:40 -08:00
firewire
i2c
isa
mips
oss sound/oss: fix deadlock in sequencer_ioctl(SNDCTL_SEQ_OUTOFBAND) 2015-05-17 09:51:33 -07:00
parisc
pci This is the 3.10.102 stable release 2017-04-18 17:22:08 +02:00
pcmcia
ppc
sh
soc Import T813XXU2BQD1 kernel source changes 2017-04-22 16:30:03 +02:00
sparc
spi
synth ALSA: synth: Fix conflicting OSS device registration on AWE32 2015-10-22 14:37:50 -07:00
usb This is the 3.10.97 stable release 2017-04-18 17:17:20 +02:00
Kconfig
Makefile
ac97_bus.c
last.c
sound_core.c
sound_firmware.c