]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Jan 2023 15:50:00 +0000 (16:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Jan 2023 15:50:00 +0000 (16:50 +0100)
added patches:
alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch
alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch

queue-5.4/alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch [new file with mode: 0644]
queue-5.4/alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch [new file with mode: 0644]
queue-5.4/series

diff --git a/queue-5.4/alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch b/queue-5.4/alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch
new file mode 100644 (file)
index 0000000..f2b2c94
--- /dev/null
@@ -0,0 +1,31 @@
+From de1ccb9e61728dd941fe0e955a7a129418657267 Mon Sep 17 00:00:00 2001
+From: Adrian Chan <adchan@google.com>
+Date: Mon, 9 Jan 2023 16:05:20 -0500
+Subject: ALSA: hda/hdmi: Add a HP device 0x8715 to force connect list
+
+From: Adrian Chan <adchan@google.com>
+
+commit de1ccb9e61728dd941fe0e955a7a129418657267 upstream.
+
+Add the 'HP Engage Flex Mini' device to the force connect list to
+enable audio through HDMI.
+
+Signed-off-by: Adrian Chan <adchan@google.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20230109210520.16060-1-adchan@google.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/pci/hda/patch_hdmi.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/sound/pci/hda/patch_hdmi.c
++++ b/sound/pci/hda/patch_hdmi.c
+@@ -1821,6 +1821,7 @@ static const struct snd_pci_quirk force_
+       SND_PCI_QUIRK(0x103c, 0x870f, "HP", 1),
+       SND_PCI_QUIRK(0x103c, 0x871a, "HP", 1),
+       SND_PCI_QUIRK(0x103c, 0x8711, "HP", 1),
++      SND_PCI_QUIRK(0x103c, 0x8715, "HP", 1),
+       SND_PCI_QUIRK(0x1462, 0xec94, "MS-7C94", 1),
+       {}
+ };
diff --git a/queue-5.4/alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch b/queue-5.4/alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch
new file mode 100644 (file)
index 0000000..b875100
--- /dev/null
@@ -0,0 +1,64 @@
+From 56b88b50565cd8b946a2d00b0c83927b7ebb055e Mon Sep 17 00:00:00 2001
+From: Clement Lecigne <clecigne@google.com>
+Date: Fri, 13 Jan 2023 13:07:45 +0100
+Subject: ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF
+
+From: Clement Lecigne <clecigne@google.com>
+
+[ Note: this is a fix that works around the bug equivalently as the
+  two upstream commits:
+   1fa4445f9adf ("ALSA: control - introduce snd_ctl_notify_one() helper")
+   56b88b50565c ("ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF")
+  but in a simpler way to fit with older stable trees -- tiwai ]
+
+Add missing locking in ctl_elem_read_user/ctl_elem_write_user which can be
+easily triggered and turned into an use-after-free.
+
+Example code paths with SNDRV_CTL_IOCTL_ELEM_READ:
+
+64-bits:
+snd_ctl_ioctl
+  snd_ctl_elem_read_user
+    [takes controls_rwsem]
+    snd_ctl_elem_read [lock properly held, all good]
+    [drops controls_rwsem]
+
+32-bits (compat):
+snd_ctl_ioctl_compat
+  snd_ctl_elem_write_read_compat
+    ctl_elem_write_read
+      snd_ctl_elem_read [missing lock, not good]
+
+CVE-2023-0266 was assigned for this issue.
+
+Signed-off-by: Clement Lecigne <clecigne@google.com>
+Cc: stable@kernel.org # 5.12 and older
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Reviewed-by: Jaroslav Kysela <perex@perex.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/core/control_compat.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/sound/core/control_compat.c
++++ b/sound/core/control_compat.c
+@@ -306,7 +306,9 @@ static int ctl_elem_read_user(struct snd
+       err = snd_power_wait(card, SNDRV_CTL_POWER_D0);
+       if (err < 0)
+               goto error;
++      down_read(&card->controls_rwsem);
+       err = snd_ctl_elem_read(card, data);
++      up_read(&card->controls_rwsem);
+       if (err < 0)
+               goto error;
+       err = copy_ctl_value_to_user(userdata, valuep, data, type, count);
+@@ -334,7 +336,9 @@ static int ctl_elem_write_user(struct sn
+       err = snd_power_wait(card, SNDRV_CTL_POWER_D0);
+       if (err < 0)
+               goto error;
++      down_write(&card->controls_rwsem);
+       err = snd_ctl_elem_write(card, file, data);
++      up_write(&card->controls_rwsem);
+       if (err < 0)
+               goto error;
+       err = copy_ctl_value_to_user(userdata, valuep, data, type, count);
index 4a921fe2c186adffe0c7b023992a9d6ebd881bdb..303f23b8fcc854402460c639bb1ac9e307b448bd 100644 (file)
@@ -601,3 +601,5 @@ selftests-set-the-build-variable-to-absolute-path.patch
 driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch
 net-sched-disallow-noqueue-for-qdisc-classes.patch
 net-ulp-prevent-ulp-without-clone-op-from-entering-the-listen-status.patch
+alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch
+alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch