android_kernel_google_msm/sound
Takashi Iwai 5a7dee22fa ALSA: hrtimer: Fix stall by hrtimer_cancel()
hrtimer_cancel() waits for the completion from the callback, thus it
must not be called inside the callback itself.  This was already a
problem in the past with ALSA hrtimer driver, and the early commit
[fcfdebe707: ALSA: hrtimer - Fix lock-up] tried to address it.

However, the previous fix is still insufficient: it may still cause a
lockup when the ALSA timer instance reprograms itself in its callback.
Then it invokes the start function even in snd_timer_interrupt() that
is called in hrtimer callback itself, results in a CPU stall.  This is
no hypothetical problem but actually triggered by syzkaller fuzzer.

This patch tries to fix the issue again.  Now we call
hrtimer_try_to_cancel() at both start and stop functions so that it
won't fall into a deadlock, yet giving some chance to cancel the queue
if the functions have been called outside the callback.  The proper
hrtimer_cancel() is called in anyway at closing, so this should be
enough.

Change-Id: Id6224b2a3ade0d217e891e6af09744df4d0b2e5c
Reported-and-tested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-10-29 23:12:35 +08: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: hrtimer: Fix stall by hrtimer_cancel() 2016-10-29 23:12:35 +08: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:Added Buffer overflow check 2016-06-03 11:59:22 -07:00
sparc
spi
synth
usb ALSA: usb-audio: avoid freeing umidi object twice 2016-10-29 23:12:35 +08: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