ALSA: seq: Check UMP support for midi_version change

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Takashi Iwai <tiwai@xxxxxxx>

commit 8765429279e7d3d68d39ace5f84af2815174bb1e 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: 46397622a3fa ("ALSA: seq: Add UMP support")
Cc: <stable@xxxxxxxxxxxxxxx>
Link: https://patch.msgid.link/20241231145358.21946-1-tiwai@xxxxxxx
Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 sound/core/seq/seq_clientmgr.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -1275,10 +1275,16 @@ static int snd_seq_ioctl_set_client_info
 	if (client->type != client_info->type)
 		return -EINVAL;
 
-	/* check validity of midi_version field */
-	if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3) &&
-	    client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0)
-		return -EINVAL;
+	if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3)) {
+		/* check validity of midi_version field */
+		if (client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0)
+			return -EINVAL;
+
+		/* check if UMP is supported in kernel */
+		if (!IS_ENABLED(CONFIG_SND_SEQ_UMP) &&
+		    client_info->midi_version > 0)
+			return -EINVAL;
+	}
 
 	/* fill the info fields */
 	if (client_info->name[0])


Patches currently in stable-queue which might be from tiwai@xxxxxxx are

queue-6.12/alsa-hda-realtek-add-support-for-asus-zen-aio-27-z27.patch
queue-6.12/sound-usb-format-don-t-warn-that-raw-dsd-is-unsuppor.patch
queue-6.12/alsa-hda-realtek-add-quirk-for-framework-f111-000c.patch
queue-6.12/revert-alsa-ump-don-t-enumeration-invalid-groups-for-legacy-rawmidi.patch
queue-6.12/alsa-hda-cs35l56-remove-calls-to-cs35l56_force_sync_.patch
queue-6.12/alsa-hda-ca0132-use-standard-hd-audio-quirk-matching.patch
queue-6.12/alsa-hda-realtek-add-new-alc2xx-fixup-headset-mic-mo.patch
queue-6.12/alsa-seq-oss-fix-races-at-processing-sysex-messages.patch
queue-6.12/alsa-seq-check-ump-support-for-midi_version-change.patch
queue-6.12/alsa-usb-audio-us16x08-initialize-array-before-use.patch
queue-6.12/sound-usb-enable-dsd-output-for-ddhifi-tc44c.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux