alistair23-linux/sound
Takashi Iwai 2ba1fe7a06 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.

Reported-and-tested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-01-18 14:33:30 +01:00
..
aoa
arm
atmel
core ALSA: hrtimer: Fix stall by hrtimer_cancel() 2016-01-18 14:33:30 +01:00
drivers ALSA: dummy: constify dummy_timer_ops structures 2015-12-30 22:49:42 +01:00
firewire ALSA: dice: expand timeout to wait for Dice notification 2016-01-06 10:18:54 +01:00
hda ASoC: Last updates for v4.5 2016-01-11 17:50:15 +01:00
i2c
isa
mips
oss
parisc
pci ALSA: hda - Fix bass pin fixup for ASUS N550JX 2016-01-18 09:17:30 +01:00
pcmcia
ppc
sh
soc ASoC: Last updates for v4.5 2016-01-11 17:50:15 +01:00
sparc
spi
synth ALSA: emux: constify nrpn_conv_table structures 2016-01-06 10:19:49 +01:00
usb ALSA: usb-audio: Fix mixer ctl regression of Native Instrument devices 2016-01-13 07:24:07 +01:00
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c
sound_firmware.c