Skip to content

Commit 396964d

Browse files
tiwaigregkh
authored andcommitted
ALSA: seq: Check UMP support for midi_version change
commit 8765429 upstream. When the kernel is built without UMP support but a user-space app requires the midi_version > 0, the kernel should return an error. Otherwise user-space assumes as if it were possible to deal, eventually hitting serious errors later. Fixes: 4639762 ("ALSA: seq: Add UMP support") Cc: <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Takashi Iwai <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 199f045 commit 396964d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

sound/core/seq/seq_clientmgr.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,10 +1280,16 @@ static int snd_seq_ioctl_set_client_info(struct snd_seq_client *client,
12801280
if (client->type != client_info->type)
12811281
return -EINVAL;
12821282

1283-
/* check validity of midi_version field */
1284-
if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3) &&
1285-
client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0)
1286-
return -EINVAL;
1283+
if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3)) {
1284+
/* check validity of midi_version field */
1285+
if (client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0)
1286+
return -EINVAL;
1287+
1288+
/* check if UMP is supported in kernel */
1289+
if (!IS_ENABLED(CONFIG_SND_SEQ_UMP) &&
1290+
client_info->midi_version > 0)
1291+
return -EINVAL;
1292+
}
12871293

12881294
/* fill the info fields */
12891295
if (client_info->name[0])

0 commit comments

Comments
 (0)