This is a note to let you know that I've just added the patch titled ALSA: hda: Fix Oops by 9.1 surround channel names to the 6.3-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-hda-fix-oops-by-9.1-surround-channel-names.patch and it can be found in the queue-6.3 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 3b44ec8c5c44790a82f07e90db45643c762878c6 Mon Sep 17 00:00:00 2001 From: Takashi Iwai <tiwai@xxxxxxx> Date: Tue, 16 May 2023 20:44:12 +0200 Subject: ALSA: hda: Fix Oops by 9.1 surround channel names From: Takashi Iwai <tiwai@xxxxxxx> commit 3b44ec8c5c44790a82f07e90db45643c762878c6 upstream. get_line_out_pfx() may trigger an Oops by overflowing the static array with more than 8 channels. This was reported for MacBookPro 12,1 with Cirrus codec. As a workaround, extend for the 9.1 channels and also fix the potential Oops by unifying the code paths accessing the same array with the proper size check. Reported-by: Olliver Schinagl <oliver@xxxxxxxxxxx> Cc: <stable@xxxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/64d95eb0-dbdb-cff8-a8b1-988dc22b24cd@xxxxxxxxxxx Link: https://lore.kernel.org/r/20230516184412.24078-1-tiwai@xxxxxxx Signed-off-by: Takashi Iwai <tiwai@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- sound/pci/hda/hda_generic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c @@ -1155,8 +1155,8 @@ static bool path_has_mixer(struct hda_co return path && path->ctls[ctl_type]; } -static const char * const channel_name[4] = { - "Front", "Surround", "CLFE", "Side" +static const char * const channel_name[] = { + "Front", "Surround", "CLFE", "Side", "Back", }; /* give some appropriate ctl name prefix for the given line out channel */ @@ -1182,7 +1182,7 @@ static const char *get_line_out_pfx(stru /* multi-io channels */ if (ch >= cfg->line_outs) - return channel_name[ch]; + goto fixed_name; switch (cfg->line_out_type) { case AUTO_PIN_SPEAKER_OUT: @@ -1234,6 +1234,7 @@ static const char *get_line_out_pfx(stru if (cfg->line_outs == 1 && !spec->multi_ios) return "Line Out"; + fixed_name: if (ch >= ARRAY_SIZE(channel_name)) { snd_BUG(); return "PCM"; Patches currently in stable-queue which might be from tiwai@xxxxxxx are queue-6.3/thunderbolt-clear-registers-properly-when-auto-clear-isn-t-in-use.patch queue-6.3/alsa-hda-realtek-add-a-quirk-for-hp-elitedesk-805.patch queue-6.3/alsa-hda-fix-oops-by-9.1-surround-channel-names.patch queue-6.3/alsa-usb-audio-add-a-sample-rate-workaround-for-line6-pod-go.patch queue-6.3/alsa-hda-lnl-add-hd-audio-pci-id.patch queue-6.3/alsa-hda-realtek-apply-hp-b-o-top-speaker-profile-to.patch queue-6.3/alsa-hda-realtek-fix-mute-and-micmute-leds-for-yet-another-hp-laptop.patch queue-6.3/alsa-firewire-digi00x-prevent-potential-use-after-fr.patch queue-6.3/alsa-hda-realtek-add-quirk-for-clevo-l140au.patch queue-6.3/alsa-hda-add-nvidia-codec-ids-a3-through-a7-to-patch-table.patch queue-6.3/alsa-hda-realtek-add-quirk-for-hp-elitebook-g10-laptops.patch queue-6.3/alsa-hda-realtek-add-quirk-for-2nd-asus-gu603.patch