Skip to content

Commit 1359905

Browse files
committed
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>
1 parent 4f92eb7 commit 1359905

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sound/core/seq/seq_clientmgr.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,8 @@ static int snd_seq_ioctl_create_port(struct snd_seq_client *client, void *arg)
12061206
port_idx = info->addr.port;
12071207
else
12081208
port_idx = -1;
1209+
if (port_idx >= SNDRV_SEQ_ADDRESS_UNKNOWN)
1210+
return -EINVAL;
12091211
err = snd_seq_create_port(client, port_idx, &port);
12101212
if (err < 0)
12111213
return err;

0 commit comments

Comments
 (0)