From 72783cf35e6c55bca84c4bb7b776c58152856fd4 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 13 Jan 2023 16:50:18 +0100 Subject: [PATCH] 5.10-stable patches 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 --- ...-on-another-dell-laptop-with-alc3254.patch | 33 ++++++++++ ...-device-0x8715-to-force-connect-list.patch | 31 +++++++++ ...ide-snd_ctl_elem_read-to-prevent-uaf.patch | 64 +++++++++++++++++++ queue-5.10/series | 3 + 4 files changed, 131 insertions(+) create mode 100644 queue-5.10/alsa-hda-enable-headset-mic-on-another-dell-laptop-with-alc3254.patch create mode 100644 queue-5.10/alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch create mode 100644 queue-5.10/alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch diff --git a/queue-5.10/alsa-hda-enable-headset-mic-on-another-dell-laptop-with-alc3254.patch b/queue-5.10/alsa-hda-enable-headset-mic-on-another-dell-laptop-with-alc3254.patch new file mode 100644 index 00000000000..c00ef898175 --- /dev/null +++ b/queue-5.10/alsa-hda-enable-headset-mic-on-another-dell-laptop-with-alc3254.patch @@ -0,0 +1,33 @@ +From a5751933a7f6abbdad90d98f25a25bb4b133a9e6 Mon Sep 17 00:00:00 2001 +From: Chris Chiu +Date: Tue, 3 Jan 2023 17:53:32 +0800 +Subject: ALSA: hda - Enable headset mic on another Dell laptop with ALC3254 + +From: Chris Chiu + +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 +Cc: +Link: https://lore.kernel.org/r/20230103095332.730677-1-chris.chiu@canonical.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 +@@ -8847,6 +8847,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.10/alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch b/queue-5.10/alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch new file mode 100644 index 00000000000..ed5cf2337f2 --- /dev/null +++ b/queue-5.10/alsa-hda-hdmi-add-a-hp-device-0x8715-to-force-connect-list.patch @@ -0,0 +1,31 @@ +From de1ccb9e61728dd941fe0e955a7a129418657267 Mon Sep 17 00:00:00 2001 +From: Adrian Chan +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 + +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 +Cc: +Link: https://lore.kernel.org/r/20230109210520.16060-1-adchan@google.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -1966,6 +1966,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.10/alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch b/queue-5.10/alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch new file mode 100644 index 00000000000..c7bef062408 --- /dev/null +++ b/queue-5.10/alsa-pcm-move-rwsem-lock-inside-snd_ctl_elem_read-to-prevent-uaf.patch @@ -0,0 +1,64 @@ +From 56b88b50565cd8b946a2d00b0c83927b7ebb055e Mon Sep 17 00:00:00 2001 +From: Clement Lecigne +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 + +[ 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 +Cc: stable@kernel.org # 5.12 and older +Signed-off-by: Takashi Iwai +Reviewed-by: Jaroslav Kysela +Signed-off-by: Greg Kroah-Hartman +--- + sound/core/control_compat.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/sound/core/control_compat.c ++++ b/sound/core/control_compat.c +@@ -304,7 +304,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); +@@ -332,7 +334,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); diff --git a/queue-5.10/series b/queue-5.10/series index 03027416a19..8f93ceb5635 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -781,3 +781,6 @@ mptcp-dedicated-request-sock-for-subflow-in-v6.patch mptcp-use-proper-req-destructor-for-ipv6.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 -- 2.47.3