summaryrefslogtreecommitdiff
path: root/sound/core/seq/seq_clientmgr.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-01-09 23:11:03 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-23 19:58:11 +0100
commitc3162384aed4cfe3f1a1f40041f3ba8cd7704d88 (patch)
treed3a0fc67ce698f30f0f9556232ac87e1c57a53e4 /sound/core/seq/seq_clientmgr.h
parent17ae6ccfe5dd85605dc44534348b506f95d16a61 (diff)
ALSA: seq: Make ioctls race-free
commit b3defb791b26ea0683a93a4f49c77ec45ec96f10 upstream. 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> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/core/seq/seq_clientmgr.h')
-rw-r--r--sound/core/seq/seq_clientmgr.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/core/seq/seq_clientmgr.h b/sound/core/seq/seq_clientmgr.h
index c6614254ef8a..0611e1e0ed5b 100644
--- a/sound/core/seq/seq_clientmgr.h
+++ b/sound/core/seq/seq_clientmgr.h
@@ -61,6 +61,7 @@ struct snd_seq_client {
struct list_head ports_list_head;
rwlock_t ports_lock;
struct mutex ports_mutex;
+ struct mutex ioctl_mutex;
int convert32; /* convert 32->64bit */
/* output pool */