]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: seq: Make ioctls race-free
authorTakashi Iwai <tiwai@suse.de>
Tue, 9 Jan 2018 22:11:03 +0000 (23:11 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 11 Jan 2018 13:37:51 +0000 (14:37 +0100)
commiteb9cacaacd2a01f9256798426cec34fd7da19073
treec9539c590735a52b90dac37d859d0e49c83d6f5e
parent016277f08f157426f9bd54b258e171a07f7c46cc
ALSA: seq: Make ioctls race-free

The ALSA sequencer ioctls have no protection against racy calls while
the concurrent operations may lead to interfere with each other.  As
reported recently, for example, the concurrent calls of setting client
pool with a combination of write calls may lead to either the
unkillable dead-lock or UAF.

As a slightly big hammer solution, this patch introduces the mutex to
make each ioctl exclusive.  Although this may reduce performance via
parallel ioctl calls, usually it's not demanded for sequencer usages,
hence it should be negligible.

Reported-by: Luo Quan <a4651386@163.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/seq/seq_clientmgr.c
sound/core/seq/seq_clientmgr.h