summaryrefslogtreecommitdiff
path: root/sound/core/seq/seq_clientmgr.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2023-05-23 09:53:44 +0200
committerTakashi Iwai <tiwai@suse.de>2023-05-23 12:11:19 +0200
commit1359905383834ed5fc294fad3954d40dbcf770af (patch)
tree90d01c15df0f8e98441b29733e3b4fce2fc22b11 /sound/core/seq/seq_clientmgr.c
parent4f92eb792e9336a46480655ed18e8b59e2a6505c (diff)
ALSA: seq: Prohibit creating ports with special numbers
Some port numbers are special, such as 254 for subscribers and 255 for broadcast. Return error if application tries to create such a port. Reviewed-by: Jaroslav Kysela <perex@perex.cz> Link: https://lore.kernel.org/r/20230523075358.9672-24-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/seq/seq_clientmgr.c')
-rw-r--r--sound/core/seq/seq_clientmgr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 2dac8c3355fd..0f26f20596d7 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1206,6 +1206,8 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg)
port_idx = info->addr.port;
else
port_idx = -1;
+ if (port_idx >= SNDRV_SEQ_ADDRESS_UNKNOWN)
+ return -EINVAL;
err = snd_seq_create_port(client, port_idx, &port);
if (err < 0)
return err;