android_kernel_samsung_msm8226/sound/core
Takashi Iwai 9ed4b93ce5 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.

Change-Id: Iad00158de5e6acd5adfa331c2e11450f2cf42390
Reported-by: Baozeng Ding <sploving1@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Willy Tarreau <w@1wt.eu>
CVE-2016-9794
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2019-08-06 12:24:26 +02:00
..
oss Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
seq Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
Kconfig Merge commit 'AU_LINUX_ANDROID_ICS.04.00.04.00.126' into msm-3.4 2012-06-06 18:45:28 -07:00
Makefile
compress_offload.c ALSA: compress: fix an integer overflow check 2019-08-06 11:48:12 +02:00
control.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
control_compat.c
ctljack.c
device.c
hrtimer.c misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00
hwdep.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
hwdep_compat.c
info.c misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00
info_oss.c
init.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
isadma.c
jack.c ALSA: jack: Add support to report second microphone 2014-01-28 20:52:50 -08:00
memalloc.c
memory.c
misc.c
pcm.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
pcm_compat.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
pcm_lib.c ALSA: pcm : Call kill_fasync() in stream lock 2019-08-06 12:24:26 +02:00
pcm_memory.c
pcm_misc.c Merge commit 'AU_LINUX_ANDROID_ICS.04.00.04.00.126' into msm-3.4 2012-06-06 18:45:28 -07:00
pcm_native.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
pcm_timer.c
rawmidi.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
rawmidi_compat.c
rtctimer.c
sgbuf.c
sound.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
sound_oss.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
timer.c Merge remote-tracking branch 'google-common/deprecated/android-3.4' into lineage-16.0 2019-08-06 11:41:21 +02:00
timer_compat.c
vmaster.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00