Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2
+2
sound/core/seq/seq_clientmgr.c
··· 1206 1206 port_idx = info->addr.port; 1207 1207 else 1208 1208 port_idx = -1; 1209 + if (port_idx >= SNDRV_SEQ_ADDRESS_UNKNOWN) 1210 + return -EINVAL; 1209 1211 err = snd_seq_create_port(client, port_idx, &port); 1210 1212 if (err < 0) 1211 1213 return err;