From 39fa0a0844f27c262766b925d1a510f0686c9053 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 23 Apr 2022 13:04:21 +0200 Subject: [PATCH] 5.17-stable patches added patches: alsa-hda-realtek-add-quirk-for-clevo-np70pnp.patch alsa-usb-audio-add-mapping-for-msi-mag-x570s-torpedo-max.patch alsa-usb-audio-clear-midi-port-active-flag-after-draining.patch --- ...-realtek-add-quirk-for-clevo-np70pnp.patch | 30 ++++++++++++++ ...apping-for-msi-mag-x570s-torpedo-max.patch | 37 +++++++++++++++++ ...midi-port-active-flag-after-draining.patch | 41 +++++++++++++++++++ queue-5.17/series | 3 ++ 4 files changed, 111 insertions(+) create mode 100644 queue-5.17/alsa-hda-realtek-add-quirk-for-clevo-np70pnp.patch create mode 100644 queue-5.17/alsa-usb-audio-add-mapping-for-msi-mag-x570s-torpedo-max.patch create mode 100644 queue-5.17/alsa-usb-audio-clear-midi-port-active-flag-after-draining.patch diff --git a/queue-5.17/alsa-hda-realtek-add-quirk-for-clevo-np70pnp.patch b/queue-5.17/alsa-hda-realtek-add-quirk-for-clevo-np70pnp.patch new file mode 100644 index 00000000000..1ae502abd9e --- /dev/null +++ b/queue-5.17/alsa-hda-realtek-add-quirk-for-clevo-np70pnp.patch @@ -0,0 +1,30 @@ +From 86222af07abf1f5f07a5873cc399c29ab8a9b8b8 Mon Sep 17 00:00:00 2001 +From: Tim Crawford +Date: Thu, 21 Apr 2022 11:04:12 -0600 +Subject: ALSA: hda/realtek: Add quirk for Clevo NP70PNP + +From: Tim Crawford + +commit 86222af07abf1f5f07a5873cc399c29ab8a9b8b8 upstream. + +Fixes headset detection on Clevo NP70PNP. + +Signed-off-by: Tim Crawford +Cc: +Link: https://lore.kernel.org/r/20220421170412.3697-1-tcrawford@system76.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -9116,6 +9116,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1558, 0x8562, "Clevo NH[57][0-9]RZ[Q]", ALC269_FIXUP_DMIC), + SND_PCI_QUIRK(0x1558, 0x8668, "Clevo NP50B[BE]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1558, 0x866d, "Clevo NP5[05]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), ++ SND_PCI_QUIRK(0x1558, 0x867c, "Clevo NP7[01]PNP", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1558, 0x867d, "Clevo NP7[01]PN[HJK]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1558, 0x8680, "Clevo NJ50LU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1558, 0x8686, "Clevo NH50[CZ]U", ALC256_FIXUP_MIC_NO_PRESENCE_AND_RESUME), diff --git a/queue-5.17/alsa-usb-audio-add-mapping-for-msi-mag-x570s-torpedo-max.patch b/queue-5.17/alsa-usb-audio-add-mapping-for-msi-mag-x570s-torpedo-max.patch new file mode 100644 index 00000000000..b6f21b30088 --- /dev/null +++ b/queue-5.17/alsa-usb-audio-add-mapping-for-msi-mag-x570s-torpedo-max.patch @@ -0,0 +1,37 @@ +From 4ddef9c4d70aae0c9029bdec7c3f7f1c1c51ff8c Mon Sep 17 00:00:00 2001 +From: Maurizio Avogadro +Date: Mon, 18 Apr 2022 15:16:12 +0200 +Subject: ALSA: usb-audio: add mapping for MSI MAG X570S Torpedo MAX. + +From: Maurizio Avogadro + +commit 4ddef9c4d70aae0c9029bdec7c3f7f1c1c51ff8c upstream. + +The USB audio device 0db0:a073 based on the Realtek ALC4080 chipset +exposes all playback volume controls as "PCM". This makes +distinguishing the individual functions hard. +The mapping already adopted for device 0db0:419c based on the same +chipset fixes the issue, apply it for this device too. + +Signed-off-by: Maurizio Avogadro +Cc: +Link: https://lore.kernel.org/r/Yl1ykPaGgsFf3SnW@ryzen +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/mixer_maps.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/sound/usb/mixer_maps.c ++++ b/sound/usb/mixer_maps.c +@@ -599,6 +599,10 @@ static const struct usbmix_ctl_map usbmi + .id = USB_ID(0x0db0, 0x419c), + .map = msi_mpg_x570s_carbon_max_wifi_alc4080_map, + }, ++ { /* MSI MAG X570S Torpedo Max */ ++ .id = USB_ID(0x0db0, 0xa073), ++ .map = msi_mpg_x570s_carbon_max_wifi_alc4080_map, ++ }, + { /* MSI TRX40 */ + .id = USB_ID(0x0db0, 0x543d), + .map = trx40_mobo_map, diff --git a/queue-5.17/alsa-usb-audio-clear-midi-port-active-flag-after-draining.patch b/queue-5.17/alsa-usb-audio-clear-midi-port-active-flag-after-draining.patch new file mode 100644 index 00000000000..6044119daec --- /dev/null +++ b/queue-5.17/alsa-usb-audio-clear-midi-port-active-flag-after-draining.patch @@ -0,0 +1,41 @@ +From 0665886ad1392e6b5bae85d7a6ccbed48dca1522 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Wed, 20 Apr 2022 15:02:47 +0200 +Subject: ALSA: usb-audio: Clear MIDI port active flag after draining + +From: Takashi Iwai + +commit 0665886ad1392e6b5bae85d7a6ccbed48dca1522 upstream. + +When a rawmidi output stream is closed, it calls the drain at first, +then does trigger-off only when the drain returns -ERESTARTSYS as a +fallback. It implies that each driver should turn off the stream +properly after the drain. Meanwhile, USB-audio MIDI interface didn't +change the port->active flag after the drain. This may leave the +output work picking up the port that is closed right now, which +eventually leads to a use-after-free for the already released rawmidi +object. + +This patch fixes the bug by properly clearing the port->active flag +after the output drain. + +Reported-by: syzbot+70e777a39907d6d5fd0a@syzkaller.appspotmail.com +Cc: +Link: https://lore.kernel.org/r/00000000000011555605dceaff03@google.com +Link: https://lore.kernel.org/r/20220420130247.22062-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/midi.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/sound/usb/midi.c ++++ b/sound/usb/midi.c +@@ -1194,6 +1194,7 @@ static void snd_usbmidi_output_drain(str + } while (drain_urbs && timeout); + finish_wait(&ep->drain_wait, &wait); + } ++ port->active = 0; + spin_unlock_irq(&ep->buffer_lock); + } + diff --git a/queue-5.17/series b/queue-5.17/series index e22840b2eb2..196c9428bfd 100644 --- a/queue-5.17/series +++ b/queue-5.17/series @@ -5,3 +5,6 @@ block-compat_ioctl-fix-range-check-in-blkgetsize.patch gfs2-assign-rgrp-glock-before-compute_bitstructs.patch scsi-ufs-core-scsi_get_lba-error-fix.patch net-sched-cls_u32-fix-netns-refcount-changes-in-u32_change.patch +alsa-usb-audio-clear-midi-port-active-flag-after-draining.patch +alsa-usb-audio-add-mapping-for-msi-mag-x570s-torpedo-max.patch +alsa-hda-realtek-add-quirk-for-clevo-np70pnp.patch -- 2.47.3