aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/seq/seq_clientmgr.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-04-12 12:44:39 +0200
committerTakashi Iwai <tiwai@suse.de>2019-04-12 13:07:25 +0200
commit6b580f523172f2c738b661069a57c23c74a75f88 (patch)
treed772938f0958be15c9f097fecfdccc39609c9b7b /sound/core/seq/seq_clientmgr.h
parentALSA: seq: Simplify snd_seq_kernel_client_enqueue() helper (diff)
downloadlinux-dev-6b580f523172f2c738b661069a57c23c74a75f88.tar.xz
linux-dev-6b580f523172f2c738b661069a57c23c74a75f88.zip
ALSA: seq: Protect racy pool manipulation from OSS sequencer
OSS sequencer emulation still allows to queue and issue the events that manipulate the client pool concurrently in a racy way. This patch serializes the access like the normal sequencer write / ioctl via taking the client ioctl_mutex. Since the access to the sequencer client is done indirectly via a client id number, a new helper to take/release the mutex is introduced. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to '')
-rw-r--r--sound/core/seq/seq_clientmgr.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/core/seq/seq_clientmgr.h b/sound/core/seq/seq_clientmgr.h
index 66ad3d547916..28a51dcc0190 100644
--- a/sound/core/seq/seq_clientmgr.h
+++ b/sound/core/seq/seq_clientmgr.h
@@ -97,6 +97,10 @@ int snd_seq_kernel_client_write_poll(int clientid, struct file *file, poll_table
int snd_seq_client_notify_subscription(int client, int port,
struct snd_seq_port_subscribe *info, int evtype);
+/* only for OSS sequencer */
+bool snd_seq_client_ioctl_lock(int clientid);
+void snd_seq_client_ioctl_unlock(int clientid);
+
extern int seq_client_load[15];
#endif