]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: timer: Fix race among timer ioctls
authorTakashi Iwai <tiwai@suse.de>
Wed, 13 Jan 2016 16:48:01 +0000 (17:48 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 14 Jan 2016 13:07:21 +0000 (14:07 +0100)
commit69e9845cf10b9424b936634362242a260b638b32
treeca51f654c1b2f2d660a211b2a21dacc57f36cb62
parente1fc608bbf5b0f49f2a6d68cbe6969b05e04fd94
ALSA: timer: Fix race among timer ioctls

ALSA timer ioctls have an open race and this may lead to a
use-after-free of timer instance object.  A simplistic fix is to make
each ioctl exclusive.  We have already tread_sem for controlling the
tread, and extend this as a global mutex to be applied to each ioctl.

The downside is, of course, the worse concurrency.  But these ioctls
aren't to be parallel accessible, in anyway, so it should be fine to
serialize there.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Tested-by: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/timer.c