This is a note to let you know that I've just added the patch titled ALSA: rawmidi: Fix NULL dereference at proc read to the 6.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: alsa-rawmidi-fix-null-dereference-at-proc-read.patch and it can be found in the queue-6.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From b2ce0027d7b2905495021c5208f92043eb493146 Mon Sep 17 00:00:00 2001 From: Takashi Iwai <tiwai@xxxxxxx> Date: Sat, 16 Sep 2023 08:07:25 +0200 Subject: ALSA: rawmidi: Fix NULL dereference at proc read From: Takashi Iwai <tiwai@xxxxxxx> commit b2ce0027d7b2905495021c5208f92043eb493146 upstream. At the implementation of the optional proc fs in rawmidi, I forgot that rmidi->ops itself is optional and can be NULL. Add the proper NULL check for avoiding the Oops. Fixes: fa030f666d24 ("ALSA: ump: Additional proc output") Reported-and-tested-by: Mark Hills <mark@xxxxxxxx> Closes: https://lore.kernel.org/r/ef9118c3-a2eb-d0ff-1efa-cc5fb6416bde@xxxxxxxx Cc: <stable@xxxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/20230916060725.11726-1-tiwai@xxxxxxx Signed-off-by: Takashi Iwai <tiwai@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/core/rawmidi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index ba06484ac4aa..1431cb997808 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c @@ -1770,7 +1770,7 @@ static void snd_rawmidi_proc_info_read(struct snd_info_entry *entry, if (IS_ENABLED(CONFIG_SND_UMP)) snd_iprintf(buffer, "Type: %s\n", rawmidi_is_ump(rmidi) ? "UMP" : "Legacy"); - if (rmidi->ops->proc_read) + if (rmidi->ops && rmidi->ops->proc_read) rmidi->ops->proc_read(entry, buffer); mutex_lock(&rmidi->open_mutex); if (rmidi->info_flags & SNDRV_RAWMIDI_INFO_OUTPUT) { -- 2.42.0 Patches currently in stable-queue which might be from tiwai@xxxxxxx are queue-6.5/alsa-seq-ump-fix-wformat-truncation-warning.patch queue-6.5/alsa-hda-disable-power-save-for-solving-pop-issue-on-lenovo-thinkcentre-m70q.patch queue-6.5/alsa-seq-avoid-delivery-of-events-for-disabled-ump-g.patch queue-6.5/alsa-rawmidi-fix-null-dereference-at-proc-read.patch queue-6.5/alsa-docs-fix-a-typo-of-midi2_ump_probe-option-for-s.patch queue-6.5/alsa-hda-realtek-splitting-the-ux3402-into-two-separ.patch queue-6.5/alsa-hda-intel-sdw-acpi-use-u8-type-for-link-index.patch