]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Jan 2023 15:50:40 +0000 (16:50 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Jan 2023 15:50:40 +0000 (16:50 +0100)
added patches:
alsa-hda-enable-headset-mic-on-another-dell-laptop-with-alc3254.patch
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.15/alsa-hda-enable-headset-mic-on-another-dell-laptop-with-alc3254.patch [new file with mode: 0644]
queue-5.15/alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch [new file with mode: 0644]
queue-5.15/alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/alsa-hda-enable-headset-mic-on-another-dell-laptop-with-alc3254.patch b/queue-5.15/alsa-hda-enable-headset-mic-on-another-dell-laptop-with-alc3254.patch
new file mode 100644 (file)
index 0000000..76dbe6c
--- /dev/null
@@ -0,0 +1,33 @@
+From a5751933a7f6abbdad90d98f25a25bb4b133a9e6 Mon Sep 17 00:00:00 2001
+From: Chris Chiu <chris.chiu@canonical.com>
+Date: Tue, 3 Jan 2023 17:53:32 +0800
+Subject: ALSA: hda - Enable headset mic on another Dell laptop with ALC3254
+
+From: Chris Chiu <chris.chiu@canonical.com>
+
+commit a5751933a7f6abbdad90d98f25a25bb4b133a9e6 upstream.
+
+There is another Dell Latitude laptop (1028:0c03) with Realtek
+codec ALC3254 which needs the ALC269_FIXUP_DELL4_MIC_NO_PRESENCE
+instead of the default matched ALC269_FIXUP_DELL1_MIC_NO_PRESENCE.
+Apply correct fixup for this particular model to enable headset mic.
+
+Signed-off-by: Chris Chiu <chris.chiu@canonical.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20230103095332.730677-1-chris.chiu@canonical.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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
+@@ -8909,6 +8909,7 @@ static const struct snd_pci_quirk alc269
+       SND_PCI_QUIRK(0x1028, 0x0b1a, "Dell Precision 5570", ALC289_FIXUP_DUAL_SPK),
+       SND_PCI_QUIRK(0x1028, 0x0b37, "Dell Inspiron 16 Plus 7620 2-in-1", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
+       SND_PCI_QUIRK(0x1028, 0x0b71, "Dell Inspiron 16 Plus 7620", ALC295_FIXUP_DELL_INSPIRON_TOP_SPEAKERS),
++      SND_PCI_QUIRK(0x1028, 0x0c03, "Dell Precision 5340", ALC269_FIXUP_DELL4_MIC_NO_PRESENCE),
+       SND_PCI_QUIRK(0x1028, 0x0c19, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
+       SND_PCI_QUIRK(0x1028, 0x0c1a, "Dell Precision 3340", ALC236_FIXUP_DELL_DUAL_CODECS),
+       SND_PCI_QUIRK(0x1028, 0x0c1b, "Dell Precision 3440", ALC236_FIXUP_DELL_DUAL_CODECS),
diff --git a/queue-5.15/alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch b/queue-5.15/alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch
new file mode 100644 (file)
index 0000000..030af95
--- /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
+@@ -1963,6 +1963,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),
+       SND_PCI_QUIRK(0x8086, 0x2081, "Intel NUC 10", 1),
+       {}
diff --git a/queue-5.15/alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch b/queue-5.15/alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch
new file mode 100644 (file)
index 0000000..53d97ed
--- /dev/null
@@ -0,0 +1,107 @@
+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>
+
+commit 56b88b50565cd8b946a2d00b0c83927b7ebb055e upstream.
+
+Takes rwsem lock inside snd_ctl_elem_read instead of snd_ctl_elem_read_user
+like it was done for write in commit 1fa4445f9adf1 ("ALSA: control - introduce
+snd_ctl_notify_one() helper"). Doing this way we are also fixing the following
+locking issue happening in the compat path which can be easily triggered and
+turned into an use-after-free.
+
+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:
+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.
+
+Cc: stable@kernel.org # 5.13+
+Signed-off-by: Clement Lecigne <clecigne@google.com>
+Reviewed-by: Jaroslav Kysela <perex@perex.cz>
+Link: https://lore.kernel.org/r/20230113120745.25464-1-tiwai@suse.de
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ sound/core/control.c |   24 +++++++++++++++---------
+ 1 file changed, 15 insertions(+), 9 deletions(-)
+
+--- a/sound/core/control.c
++++ b/sound/core/control.c
+@@ -1067,14 +1067,19 @@ static int snd_ctl_elem_read(struct snd_
+       const u32 pattern = 0xdeadbeef;
+       int ret;
++      down_read(&card->controls_rwsem);
+       kctl = snd_ctl_find_id(card, &control->id);
+-      if (kctl == NULL)
+-              return -ENOENT;
++      if (kctl == NULL) {
++              ret = -ENOENT;
++              goto unlock;
++      }
+       index_offset = snd_ctl_get_ioff(kctl, &control->id);
+       vd = &kctl->vd[index_offset];
+-      if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL)
+-              return -EPERM;
++      if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_READ) || kctl->get == NULL) {
++              ret = -EPERM;
++              goto unlock;
++      }
+       snd_ctl_build_ioff(&control->id, kctl, index_offset);
+@@ -1084,7 +1089,7 @@ static int snd_ctl_elem_read(struct snd_
+       info.id = control->id;
+       ret = __snd_ctl_elem_info(card, kctl, &info, NULL);
+       if (ret < 0)
+-              return ret;
++              goto unlock;
+ #endif
+       if (!snd_ctl_skip_validation(&info))
+@@ -1094,7 +1099,7 @@ static int snd_ctl_elem_read(struct snd_
+               ret = kctl->get(kctl, control);
+       snd_power_unref(card);
+       if (ret < 0)
+-              return ret;
++              goto unlock;
+       if (!snd_ctl_skip_validation(&info) &&
+           sanity_check_elem_value(card, control, &info, pattern) < 0) {
+               dev_err(card->dev,
+@@ -1102,8 +1107,11 @@ static int snd_ctl_elem_read(struct snd_
+                       control->id.iface, control->id.device,
+                       control->id.subdevice, control->id.name,
+                       control->id.index);
+-              return -EINVAL;
++              ret = -EINVAL;
++              goto unlock;
+       }
++unlock:
++      up_read(&card->controls_rwsem);
+       return ret;
+ }
+@@ -1117,9 +1125,7 @@ static int snd_ctl_elem_read_user(struct
+       if (IS_ERR(control))
+               return PTR_ERR(control);
+-      down_read(&card->controls_rwsem);
+       result = snd_ctl_elem_read(card, control);
+-      up_read(&card->controls_rwsem);
+       if (result < 0)
+               goto error;
index bf21e837c90be50ae35d121c63d36e0b7d50a030..8ade24815c62be3f803f7127c31b28b0683e9955 100644 (file)
@@ -8,3 +8,6 @@ selftests-vm-pkeys-add-a-regression-test-for-setting-pkru-through-ptrace.patch
 serial-fixup-backport-of-serial-deassert-transmit-enable-on-probe-in-driver-specific-way.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
+alsa-hda-enable-headset-mic-on-another-dell-laptop-with-alc3254.patch