android_kernel_samsung_msm8976/sound/core
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
..
oss ALSA: pcm: Fix potential deadlock in OSS emulation 2016-02-19 14:22:39 -08:00
seq Import latest Samsung release 2017-04-18 03:43:52 +02:00
compress_offload.c This is the 3.10.97 stable release 2017-04-18 17:17:20 +02:00
control.c This is the 3.10.96 stable release 2017-04-18 17:16:02 +02:00
control_compat.c ALSA: ctl: Fix ioctls for X32 ABI 2016-03-09 15:31:55 -08:00
ctljack.c
device.c
hrtimer.c Import latest Samsung release 2017-04-18 03:43:52 +02:00
hwdep.c
hwdep_compat.c
info.c Merge tag 'LA.BR.1.3.6-03510-8976.0' into HEAD 2017-04-18 12:11:50 +02:00
info_oss.c
init.c
isadma.c
jack.c
Kconfig
Makefile
memalloc.c
memory.c
misc.c
pcm.c ASoC: Fix freed memory access of pcm stream kctl 2016-08-10 11:03:43 -07:00
pcm_compat.c This is the 3.10.96 stable release 2017-04-18 17:16:02 +02:00
pcm_lib.c ALSA: pcm : Call kill_fasync() in stream lock 2017-04-22 23:02:55 +02:00
pcm_memory.c
pcm_misc.c
pcm_native.c ALSA: pcm: add support for 384KHz sample rate 2015-11-19 02:39:29 -08:00
pcm_timer.c
rawmidi.c ALSA: rawmidi: Fix race at copying & updating the position 2016-02-19 14:22:39 -08:00
rawmidi_compat.c ALSA: rawmidi: Fix ioctls X32 ABI 2016-03-09 15:31:55 -08:00
rtctimer.c
sgbuf.c
sound.c
sound_oss.c
timer.c This is the 3.10.102 stable release 2017-04-18 17:22:08 +02:00
timer_compat.c ALSA: timer: Fix broken compat timer user status ioctl 2016-03-09 15:31:55 -08:00
vmaster.c