android_kernel_google_msm/sound
Takashi Iwai a2b06797f9 ALSA: pcm : Call kill_fasync() in stream lock
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>
(cherry picked from commit 3aa02cb664c5fb1042958c8d1aa8c35055a2ebc4)

Change-Id: I921b3b0b4a7dfaa6267df71676d99e8dc2fb303f
2017-03-07 05:44:50 +00:00
..
aoa
arm ARM: cleanups of io includes 2012-03-29 18:02:10 -07:00
atmel
compress_offload Fixes for 1. fixes for comments recieved on alsa-devel 2013-02-25 11:41:23 -08:00
core ALSA: pcm : Call kill_fasync() in stream lock 2017-03-07 05:44:50 +00:00
drivers Documentation: remove references to /etc/modprobe.conf 2012-03-30 16:03:15 -07:00
firewire IEEE 1394 (FireWire) subsystem updates post v3.3: 2012-03-22 20:31:15 -07:00
i2c [media] tea575x: fix HW seek 2012-03-19 11:28:52 -03:00
isa ALSA: sound/isa/sscape.c: add missing resource-release code 2012-04-10 08:42:07 +02:00
mips
oss sound: sound/oss/msnd_pinnacle.c: add vfrees 2012-04-10 08:41:54 +02:00
parisc
pci sound fixes for 3.4 2012-05-16 14:29:45 -07:00
pcmcia
ppc
sh
soc ASoC: msm: audio-effects: misc fixes in h/w accelerated 2016-10-31 23:20:27 +11:00
sparc
spi
synth
usb ALSA: usb-audio: Fix double-free in error paths after snd_usb_add_audio_stream() call 2016-11-11 13:37:28 +11:00
ac97_bus.c
Kconfig
last.c ALSA: workaround: change the timing of alsa_sound_last_init() 2012-04-19 13:51:54 +02:00
Makefile
sound_core.c
sound_firmware.c