]> www.infradead.org Git - users/jedix/linux-maple.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)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 26 May 2016 22:43:14 +0000 (15:43 -0700)
commit1563bd4b3ba9aae382abdf0ad0ac746d489ddc66
tree81cd9ecaeeb47466086d42b224b26e3c994f98b9
parente7faa15b82b82d34b1df4ce4875a594bc0b82bf4
ALSA: timer: Fix race among timer ioctls

Orabug: 23330528

commit af368027a49a751d6ff4ee9e3f9961f35bb4fede upstream.

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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit ac905ca58370789645e813d8abfa5871c93e9e36)

Signed-off-by: Dan Duval <dan.duval@oracle.com>
sound/core/timer.c