]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
ALSA: seq: Fix yet another races among ALSA timer accesses
authorTakashi Iwai <tiwai@suse.de>
Sat, 30 Jan 2016 22:30:25 +0000 (23:30 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Feb 2016 20:30:59 +0000 (12:30 -0800)
commit3ed5d283254aab50d90525d8ea4dd713aac08d1d
treef7fbff531d8a1295f3160e7c6a4ba9b5c89cdfae
parentf8ae77d05089c8a7d3b626cd783970a55dba5577
ALSA: seq: Fix yet another races among ALSA timer accesses

commit 2cdc7b636d55cbcf42e1e6c8accd85e62d3e9ae8 upstream.

ALSA sequencer may open/close and control ALSA timer instance
dynamically either via sequencer events or direct ioctls.  These are
done mostly asynchronously, and it may call still some timer action
like snd_timer_start() while another is calling snd_timer_close().
Since the instance gets removed by snd_timer_close(), it may lead to
a use-after-free.

This patch tries to address such a race by protecting each
snd_timer_*() call via the existing spinlock and also by avoiding the
access to timer during close call.

BugLink: http://lkml.kernel.org/r/CACT4Y+Z6RzW5MBr-HUdV-8zwg71WQfKTdPpYGvOeS7v4cyurNQ@mail.gmail.com
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/core/seq/seq_timer.c