From: Greg Kroah-Hartman Date: Fri, 23 Sep 2022 17:57:40 +0000 (+0200) Subject: 5.4-stable patches X-Git-Tag: v4.9.330~82 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07d7b7e23dac365c527cdcefa2ca22cd499c7140;p=thirdparty%2Fkernel%2Fstable-queue.git 5.4-stable patches added patches: alsa-hda-add-intel-5-series-3400-pci-did.patch alsa-hda-realtek-add-pincfg-for-asus-g513-hp-jack.patch alsa-hda-realtek-add-pincfg-for-asus-g533z-hp-jack.patch alsa-hda-realtek-add-quirk-for-asus-ga503r-laptop.patch alsa-hda-realtek-add-quirk-for-huawei-wrt-wx9.patch alsa-hda-realtek-enable-4-speaker-output-dell-precision-5530-laptop.patch alsa-hda-realtek-re-arrange-quirk-table-entries.patch efi-libstub-check-shim-mode-using-moksbstatert.patch --- diff --git a/queue-5.4/alsa-hda-add-intel-5-series-3400-pci-did.patch b/queue-5.4/alsa-hda-add-intel-5-series-3400-pci-did.patch new file mode 100644 index 00000000000..bb98d9b195c --- /dev/null +++ b/queue-5.4/alsa-hda-add-intel-5-series-3400-pci-did.patch @@ -0,0 +1,34 @@ +From 4d40ceef4745536289012670103c59264e0fb3ec Mon Sep 17 00:00:00 2001 +From: Kai Vehmanen +Date: Mon, 12 Sep 2022 21:37:16 +0300 +Subject: ALSA: hda: add Intel 5 Series / 3400 PCI DID + +From: Kai Vehmanen + +commit 4d40ceef4745536289012670103c59264e0fb3ec upstream. + +Handle 0x3b57 variant with same AZX_DCAPS_INTEL_PCH_NOPM +capabilities as 0x3b56. In practise this allow use of HDMI/DP +display audio via i915. + +BugLink: https://gitlab.freedesktop.org/drm/intel/-/issues/2751 +Signed-off-by: Kai Vehmanen +Cc: +Link: https://lore.kernel.org/r/20220912183716.2126312-1-kai.vehmanen@linux.intel.com +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/hda_intel.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/sound/pci/hda/hda_intel.c ++++ b/sound/pci/hda/hda_intel.c +@@ -2528,6 +2528,8 @@ static const struct pci_device_id azx_id + /* 5 Series/3400 */ + { PCI_DEVICE(0x8086, 0x3b56), + .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM }, ++ { PCI_DEVICE(0x8086, 0x3b57), ++ .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_NOPM }, + /* Poulsbo */ + { PCI_DEVICE(0x8086, 0x811b), + .driver_data = AZX_DRIVER_SCH | AZX_DCAPS_INTEL_PCH_BASE }, diff --git a/queue-5.4/alsa-hda-realtek-add-pincfg-for-asus-g513-hp-jack.patch b/queue-5.4/alsa-hda-realtek-add-pincfg-for-asus-g513-hp-jack.patch new file mode 100644 index 00000000000..1ef960c52ff --- /dev/null +++ b/queue-5.4/alsa-hda-realtek-add-pincfg-for-asus-g513-hp-jack.patch @@ -0,0 +1,56 @@ +From c611e659044168e7abcbae8ba1ea833521498fbb Mon Sep 17 00:00:00 2001 +From: "Luke D. Jones" +Date: Thu, 15 Sep 2022 20:09:19 +1200 +Subject: ALSA: hda/realtek: Add pincfg for ASUS G513 HP jack + +From: Luke D. Jones + +commit c611e659044168e7abcbae8ba1ea833521498fbb upstream. + +Fixes up the pincfg for ASUS ROG Strix G513 headphone and mic combo jack + +[ Fixed the position in the quirk table by tiwai ] + +Signed-off-by: Luke D. Jones +Cc: +Link: https://lore.kernel.org/r/20220915080921.35563-2-luke@ljones.dev +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -6484,6 +6484,7 @@ enum { + ALC294_FIXUP_ASUS_GU502_HP, + ALC294_FIXUP_ASUS_GU502_PINS, + ALC294_FIXUP_ASUS_GU502_VERBS, ++ ALC294_FIXUP_ASUS_G513_PINS, + ALC285_FIXUP_HP_GPIO_LED, + ALC285_FIXUP_HP_MUTE_LED, + ALC236_FIXUP_HP_GPIO_LED, +@@ -7761,6 +7762,15 @@ static const struct hda_fixup alc269_fix + .type = HDA_FIXUP_FUNC, + .v.func = alc294_fixup_gu502_hp, + }, ++ [ALC294_FIXUP_ASUS_G513_PINS] = { ++ .type = HDA_FIXUP_PINS, ++ .v.pins = (const struct hda_pintbl[]) { ++ { 0x19, 0x03a11050 }, /* front HP mic */ ++ { 0x1a, 0x03a11c30 }, /* rear external mic */ ++ { 0x21, 0x03211420 }, /* front HP out */ ++ { } ++ }, ++ }, + [ALC294_FIXUP_ASUS_COEF_1B] = { + .type = HDA_FIXUP_VERBS, + .v.verbs = (const struct hda_verb[]) { +@@ -8253,6 +8263,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), + SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), + SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), ++ SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS), + SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), + SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), + SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), diff --git a/queue-5.4/alsa-hda-realtek-add-pincfg-for-asus-g533z-hp-jack.patch b/queue-5.4/alsa-hda-realtek-add-pincfg-for-asus-g533z-hp-jack.patch new file mode 100644 index 00000000000..6e3770d98be --- /dev/null +++ b/queue-5.4/alsa-hda-realtek-add-pincfg-for-asus-g533z-hp-jack.patch @@ -0,0 +1,56 @@ +From bc2c23549ccd7105eb6ff0d4f0ac519285628673 Mon Sep 17 00:00:00 2001 +From: "Luke D. Jones" +Date: Thu, 15 Sep 2022 20:09:20 +1200 +Subject: ALSA: hda/realtek: Add pincfg for ASUS G533Z HP jack + +From: Luke D. Jones + +commit bc2c23549ccd7105eb6ff0d4f0ac519285628673 upstream. + +Fixes up the pincfg for ASUS ROG Strix G15 (G533Z) headphone combo jack + +[ Fixed the position in the quirk table by tiwai ] + +Signed-off-by: Luke D. Jones +Cc: +Link: https://lore.kernel.org/r/20220915080921.35563-3-luke@ljones.dev +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -6485,6 +6485,7 @@ enum { + ALC294_FIXUP_ASUS_GU502_PINS, + ALC294_FIXUP_ASUS_GU502_VERBS, + ALC294_FIXUP_ASUS_G513_PINS, ++ ALC285_FIXUP_ASUS_G533Z_PINS, + ALC285_FIXUP_HP_GPIO_LED, + ALC285_FIXUP_HP_MUTE_LED, + ALC236_FIXUP_HP_GPIO_LED, +@@ -7771,6 +7772,15 @@ static const struct hda_fixup alc269_fix + { } + }, + }, ++ [ALC285_FIXUP_ASUS_G533Z_PINS] = { ++ .type = HDA_FIXUP_PINS, ++ .v.pins = (const struct hda_pintbl[]) { ++ { 0x14, 0x90170120 }, ++ { } ++ }, ++ .chained = true, ++ .chain_id = ALC294_FIXUP_ASUS_G513_PINS, ++ }, + [ALC294_FIXUP_ASUS_COEF_1B] = { + .type = HDA_FIXUP_VERBS, + .v.verbs = (const struct hda_verb[]) { +@@ -8258,6 +8268,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), + SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), ++ SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS), + SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), + SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401), + SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), diff --git a/queue-5.4/alsa-hda-realtek-add-quirk-for-asus-ga503r-laptop.patch b/queue-5.4/alsa-hda-realtek-add-quirk-for-asus-ga503r-laptop.patch new file mode 100644 index 00000000000..3a5a023072d --- /dev/null +++ b/queue-5.4/alsa-hda-realtek-add-quirk-for-asus-ga503r-laptop.patch @@ -0,0 +1,34 @@ +From ba1f818053b0668a1ce2fe86b840e81b592cc560 Mon Sep 17 00:00:00 2001 +From: "Luke D. Jones" +Date: Thu, 15 Sep 2022 20:09:21 +1200 +Subject: ALSA: hda/realtek: Add quirk for ASUS GA503R laptop + +From: Luke D. Jones + +commit ba1f818053b0668a1ce2fe86b840e81b592cc560 upstream. + +The ASUS G15 2022 (GA503R) series laptop has the same node-to-DAC pairs +as early models and the G14, this includes bass speakers which are by +default mapped incorrectly to the 0x06 node. + +Add a quirk to use the same DAC pairs as the G14. + +Signed-off-by: Luke D. Jones +Cc: +Link: https://lore.kernel.org/r/20220915080921.35563-4-luke@ljones.dev +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 +@@ -8276,6 +8276,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), + SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS), + SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), ++ SND_PCI_QUIRK(0x1043, 0x1c52, "ASUS Zephyrus G15 2022", ALC289_FIXUP_ASUS_GA401), + SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), + SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), + SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), diff --git a/queue-5.4/alsa-hda-realtek-add-quirk-for-huawei-wrt-wx9.patch b/queue-5.4/alsa-hda-realtek-add-quirk-for-huawei-wrt-wx9.patch new file mode 100644 index 00000000000..55ce35698f7 --- /dev/null +++ b/queue-5.4/alsa-hda-realtek-add-quirk-for-huawei-wrt-wx9.patch @@ -0,0 +1,30 @@ +From cbcdf8c4d35cd74aee8581eb2f0453e0ecab7b05 Mon Sep 17 00:00:00 2001 +From: huangwenhui +Date: Tue, 13 Sep 2022 13:46:22 +0800 +Subject: ALSA: hda/realtek: Add quirk for Huawei WRT-WX9 + +From: huangwenhui + +commit cbcdf8c4d35cd74aee8581eb2f0453e0ecab7b05 upstream. + +Fixes headphone and headset microphone detection on Huawei WRT-WX9. + +Signed-off-by: huangwenhui +Cc: +Link: https://lore.kernel.org/r/20220913054622.15979-1-huangwenhuia@uniontech.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 +@@ -8425,6 +8425,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x17aa, 0x511f, "Thinkpad", ALC298_FIXUP_TPT470_DOCK), + SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD), + SND_PCI_QUIRK(0x19e5, 0x3204, "Huawei MACH-WX9", ALC256_FIXUP_HUAWEI_MACH_WX9_PINS), ++ SND_PCI_QUIRK(0x19e5, 0x320f, "Huawei WRT-WX9 ", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1b35, 0x1235, "CZC B20", ALC269_FIXUP_CZC_B20), + SND_PCI_QUIRK(0x1b35, 0x1236, "CZC TMI", ALC269_FIXUP_CZC_TMI), + SND_PCI_QUIRK(0x1b35, 0x1237, "CZC L101", ALC269_FIXUP_CZC_L101), diff --git a/queue-5.4/alsa-hda-realtek-enable-4-speaker-output-dell-precision-5530-laptop.patch b/queue-5.4/alsa-hda-realtek-enable-4-speaker-output-dell-precision-5530-laptop.patch new file mode 100644 index 00000000000..0db3ca43b06 --- /dev/null +++ b/queue-5.4/alsa-hda-realtek-enable-4-speaker-output-dell-precision-5530-laptop.patch @@ -0,0 +1,33 @@ +From 1885ff13d4c42910b37a0e3f7c2f182520f4eed1 Mon Sep 17 00:00:00 2001 +From: Callum Osmotherly +Date: Thu, 15 Sep 2022 22:36:08 +0930 +Subject: ALSA: hda/realtek: Enable 4-speaker output Dell Precision 5530 laptop + +From: Callum Osmotherly + +commit 1885ff13d4c42910b37a0e3f7c2f182520f4eed1 upstream. + +Just as with the 5570 (and the other Dell laptops), this enables the two +subwoofer speakers on the Dell Precision 5530 together with the main +ones, significantly increasing the audio quality. I've tested this +myself on a 5530 and can confirm it's working as expected. + +Signed-off-by: Callum Osmotherly +Cc: +Link: https://lore.kernel.org/r/YyMjQO3mhyXlMbCf@piranha +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 +@@ -8138,6 +8138,7 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), + SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), + SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), ++ SND_PCI_QUIRK(0x1028, 0x087d, "Dell Precision 5530", ALC289_FIXUP_DUAL_SPK), + SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), diff --git a/queue-5.4/alsa-hda-realtek-re-arrange-quirk-table-entries.patch b/queue-5.4/alsa-hda-realtek-re-arrange-quirk-table-entries.patch new file mode 100644 index 00000000000..cda04f5a598 --- /dev/null +++ b/queue-5.4/alsa-hda-realtek-re-arrange-quirk-table-entries.patch @@ -0,0 +1,53 @@ +From b16c8f229a58eaddfc58aab447253464abd3c85e Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Thu, 15 Sep 2022 17:47:24 +0200 +Subject: ALSA: hda/realtek: Re-arrange quirk table entries + +From: Takashi Iwai + +commit b16c8f229a58eaddfc58aab447253464abd3c85e upstream. + +A few entries have been mistakenly inserted in wrong positions without +considering the SSID ordering. Place them at right positions. + +Fixes: b7557267c233 ("ALSA: hda/realtek: Add quirk for ASUS GA402") +Fixes: 94db9cc8f8fa ("ALSA: hda/realtek: Add quirk for ASUS GU603") +Fixes: 739d0959fbed ("ALSA: hda: Add quirk for ASUS Flow x13") +Cc: +Link: https://lore.kernel.org/r/20220915154724.31634-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/hda/patch_realtek.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/sound/pci/hda/patch_realtek.c ++++ b/sound/pci/hda/patch_realtek.c +@@ -8229,10 +8229,11 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), + SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), + SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A), ++ SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK), ++ SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), + SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), + SND_PCI_QUIRK(0x1043, 0x1740, "ASUS UX430UA", ALC295_FIXUP_ASUS_DACS), + SND_PCI_QUIRK(0x1043, 0x17d1, "ASUS UX431FL", ALC294_FIXUP_ASUS_DUAL_SPK), +- SND_PCI_QUIRK(0x1043, 0x1662, "ASUS GV301QH", ALC294_FIXUP_ASUS_DUAL_SPK), + SND_PCI_QUIRK(0x1043, 0x1881, "ASUS Zephyrus S/M", ALC294_FIXUP_ASUS_GX502_PINS), + SND_PCI_QUIRK(0x1043, 0x18b1, "Asus MJ401TA", ALC256_FIXUP_ASUS_HEADSET_MIC), + SND_PCI_QUIRK(0x1043, 0x18f1, "Asus FX505DT", ALC256_FIXUP_ASUS_HEADSET_MIC), +@@ -8248,13 +8249,12 @@ static const struct snd_pci_quirk alc269 + SND_PCI_QUIRK(0x1043, 0x1bbd, "ASUS Z550MA", ALC255_FIXUP_ASUS_MIC_NO_PRESENCE), + SND_PCI_QUIRK(0x1043, 0x1c23, "Asus X55U", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), + SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), ++ SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401), + SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), + SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), + SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), + SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), + SND_PCI_QUIRK(0x1043, 0x1f11, "ASUS Zephyrus G14", ALC289_FIXUP_ASUS_GA401), +- SND_PCI_QUIRK(0x1043, 0x1d42, "ASUS Zephyrus G14 2022", ALC289_FIXUP_ASUS_GA401), +- SND_PCI_QUIRK(0x1043, 0x16b2, "ASUS GU603", ALC289_FIXUP_ASUS_GA401), + SND_PCI_QUIRK(0x1043, 0x3030, "ASUS ZN270IE", ALC256_FIXUP_ASUS_AIO_GPIO2), + SND_PCI_QUIRK(0x1043, 0x831a, "ASUS P901", ALC269_FIXUP_STEREO_DMIC), + SND_PCI_QUIRK(0x1043, 0x834a, "ASUS S101", ALC269_FIXUP_STEREO_DMIC), diff --git a/queue-5.4/efi-libstub-check-shim-mode-using-moksbstatert.patch b/queue-5.4/efi-libstub-check-shim-mode-using-moksbstatert.patch new file mode 100644 index 00000000000..26c8cf9a705 --- /dev/null +++ b/queue-5.4/efi-libstub-check-shim-mode-using-moksbstatert.patch @@ -0,0 +1,63 @@ +From 5f56a74cc0a6d9b9f8ba89cea29cd7c4774cb2b1 Mon Sep 17 00:00:00 2001 +From: Ard Biesheuvel +Date: Tue, 20 Sep 2022 17:08:23 +0200 +Subject: efi: libstub: check Shim mode using MokSBStateRT + +From: Ard Biesheuvel + +commit 5f56a74cc0a6d9b9f8ba89cea29cd7c4774cb2b1 upstream. + +We currently check the MokSBState variable to decide whether we should +treat UEFI secure boot as being disabled, even if the firmware thinks +otherwise. This is used by shim to indicate that it is not checking +signatures on boot images. In the kernel, we use this to relax lockdown +policies. + +However, in cases where shim is not even being used, we don't want this +variable to interfere with lockdown, given that the variable may be +non-volatile and therefore persist across a reboot. This means setting +it once will persistently disable lockdown checks on a given system. + +So switch to the mirrored version of this variable, called MokSBStateRT, +which is supposed to be volatile, and this is something we can check. + +Cc: # v4.19+ +Signed-off-by: Ard Biesheuvel +Reviewed-by: Ilias Apalodimas +Reviewed-by: Peter Jones +Signed-off-by: Greg Kroah-Hartman +--- + drivers/firmware/efi/libstub/secureboot.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/firmware/efi/libstub/secureboot.c ++++ b/drivers/firmware/efi/libstub/secureboot.c +@@ -19,7 +19,7 @@ static const efi_char16_t efi_SetupMode_ + + /* SHIM variables */ + static const efi_guid_t shim_guid = EFI_SHIM_LOCK_GUID; +-static const efi_char16_t shim_MokSBState_name[] = L"MokSBState"; ++static const efi_char16_t shim_MokSBState_name[] = L"MokSBStateRT"; + + #define get_efi_var(name, vendor, ...) \ + efi_call_runtime(get_variable, \ +@@ -58,8 +58,8 @@ enum efi_secureboot_mode efi_get_secureb + + /* + * See if a user has put the shim into insecure mode. If so, and if the +- * variable doesn't have the runtime attribute set, we might as well +- * honor that. ++ * variable doesn't have the non-volatile attribute set, we might as ++ * well honor that. + */ + size = sizeof(moksbstate); + status = get_efi_var(shim_MokSBState_name, &shim_guid, +@@ -68,7 +68,7 @@ enum efi_secureboot_mode efi_get_secureb + /* If it fails, we don't care why. Default to secure */ + if (status != EFI_SUCCESS) + goto secure_boot_enabled; +- if (!(attr & EFI_VARIABLE_RUNTIME_ACCESS) && moksbstate == 1) ++ if (!(attr & EFI_VARIABLE_NON_VOLATILE) && moksbstate == 1) + return efi_secureboot_mode_disabled; + + secure_boot_enabled: diff --git a/queue-5.4/series b/queue-5.4/series index 9ba22565ba1..8e478e65ed1 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -58,3 +58,11 @@ usb-core-fix-rst-error-in-hub.c.patch usb-serial-option-add-quectel-bg95-0x0203-composition.patch usb-serial-option-add-quectel-rm520n.patch alsa-hda-tegra-set-depop-delay-for-tegra.patch +alsa-hda-add-intel-5-series-3400-pci-did.patch +alsa-hda-realtek-add-quirk-for-huawei-wrt-wx9.patch +alsa-hda-realtek-re-arrange-quirk-table-entries.patch +alsa-hda-realtek-add-pincfg-for-asus-g513-hp-jack.patch +alsa-hda-realtek-add-pincfg-for-asus-g533z-hp-jack.patch +alsa-hda-realtek-add-quirk-for-asus-ga503r-laptop.patch +alsa-hda-realtek-enable-4-speaker-output-dell-precision-5530-laptop.patch +efi-libstub-check-shim-mode-using-moksbstatert.patch