]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 Jul 2019 15:57:32 +0000 (17:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 Jul 2019 15:57:32 +0000 (17:57 +0200)
added patches:
usb-pci-quirks-correct-amd-pll-quirk-detection.patch
usb-wusbcore-fix-unbalanced-get-put-cluster_id.patch
x86-speculation-mds-apply-more-accurate-check-on-hypervisor-platform.patch
x86-sysfb_efi-add-quirks-for-some-devices-with-swapped-width-and-height.patch

queue-4.4/series
queue-4.4/usb-pci-quirks-correct-amd-pll-quirk-detection.patch [new file with mode: 0644]
queue-4.4/usb-wusbcore-fix-unbalanced-get-put-cluster_id.patch [new file with mode: 0644]
queue-4.4/x86-speculation-mds-apply-more-accurate-check-on-hypervisor-platform.patch [new file with mode: 0644]
queue-4.4/x86-sysfb_efi-add-quirks-for-some-devices-with-swapped-width-and-height.patch [new file with mode: 0644]

index 137dd1577246fcff79b742830510e61923edebe3..136e11935365c0c956973f33dbc0f83da66474cc 100644 (file)
@@ -136,3 +136,7 @@ mm-kmemleak.c-fix-check-for-softirq-context.patch
 mm-mmu_notifier-use-hlist_add_head_rcu.patch
 locking-lockdep-fix-lock-used-or-unused-stats-error.patch
 locking-lockdep-hide-unused-class-variable.patch
+usb-wusbcore-fix-unbalanced-get-put-cluster_id.patch
+usb-pci-quirks-correct-amd-pll-quirk-detection.patch
+x86-sysfb_efi-add-quirks-for-some-devices-with-swapped-width-and-height.patch
+x86-speculation-mds-apply-more-accurate-check-on-hypervisor-platform.patch
diff --git a/queue-4.4/usb-pci-quirks-correct-amd-pll-quirk-detection.patch b/queue-4.4/usb-pci-quirks-correct-amd-pll-quirk-detection.patch
new file mode 100644 (file)
index 0000000..6d953b6
--- /dev/null
@@ -0,0 +1,103 @@
+From f3dccdaade4118070a3a47bef6b18321431f9ac6 Mon Sep 17 00:00:00 2001
+From: Ryan Kennedy <ryan5544@gmail.com>
+Date: Thu, 4 Jul 2019 11:35:28 -0400
+Subject: usb: pci-quirks: Correct AMD PLL quirk detection
+
+From: Ryan Kennedy <ryan5544@gmail.com>
+
+commit f3dccdaade4118070a3a47bef6b18321431f9ac6 upstream.
+
+The AMD PLL USB quirk is incorrectly enabled on newer Ryzen
+chipsets. The logic in usb_amd_find_chipset_info currently checks
+for unaffected chipsets rather than affected ones. This broke
+once a new chipset was added in e788787ef. It makes more sense
+to reverse the logic so it won't need to be updated as new
+chipsets are added. Note that the core of the workaround in
+usb_amd_quirk_pll does correctly check the chipset.
+
+Signed-off-by: Ryan Kennedy <ryan5544@gmail.com>
+Fixes: e788787ef4f9 ("usb:xhci:Add quirk for Certain failing HP keyboard on reset after resume")
+Cc: stable <stable@vger.kernel.org>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Link: https://lore.kernel.org/r/20190704153529.9429-2-ryan5544@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/host/pci-quirks.c |   31 +++++++++++++++++++------------
+ 1 file changed, 19 insertions(+), 12 deletions(-)
+
+--- a/drivers/usb/host/pci-quirks.c
++++ b/drivers/usb/host/pci-quirks.c
+@@ -178,7 +178,7 @@ int usb_amd_find_chipset_info(void)
+ {
+       unsigned long flags;
+       struct amd_chipset_info info;
+-      int ret;
++      int need_pll_quirk = 0;
+       spin_lock_irqsave(&amd_lock, flags);
+@@ -192,21 +192,28 @@ int usb_amd_find_chipset_info(void)
+       spin_unlock_irqrestore(&amd_lock, flags);
+       if (!amd_chipset_sb_type_init(&info)) {
+-              ret = 0;
+               goto commit;
+       }
+-      /* Below chipset generations needn't enable AMD PLL quirk */
+-      if (info.sb_type.gen == AMD_CHIPSET_UNKNOWN ||
+-                      info.sb_type.gen == AMD_CHIPSET_SB600 ||
+-                      info.sb_type.gen == AMD_CHIPSET_YANGTZE ||
+-                      (info.sb_type.gen == AMD_CHIPSET_SB700 &&
+-                      info.sb_type.rev > 0x3b)) {
++      switch (info.sb_type.gen) {
++      case AMD_CHIPSET_SB700:
++              need_pll_quirk = info.sb_type.rev <= 0x3B;
++              break;
++      case AMD_CHIPSET_SB800:
++      case AMD_CHIPSET_HUDSON2:
++      case AMD_CHIPSET_BOLTON:
++              need_pll_quirk = 1;
++              break;
++      default:
++              need_pll_quirk = 0;
++              break;
++      }
++
++      if (!need_pll_quirk) {
+               if (info.smbus_dev) {
+                       pci_dev_put(info.smbus_dev);
+                       info.smbus_dev = NULL;
+               }
+-              ret = 0;
+               goto commit;
+       }
+@@ -225,7 +232,7 @@ int usb_amd_find_chipset_info(void)
+               }
+       }
+-      ret = info.probe_result = 1;
++      need_pll_quirk = info.probe_result = 1;
+       printk(KERN_DEBUG "QUIRK: Enable AMD PLL fix\n");
+ commit:
+@@ -236,7 +243,7 @@ commit:
+               /* Mark that we where here */
+               amd_chipset.probe_count++;
+-              ret = amd_chipset.probe_result;
++              need_pll_quirk = amd_chipset.probe_result;
+               spin_unlock_irqrestore(&amd_lock, flags);
+@@ -250,7 +257,7 @@ commit:
+               spin_unlock_irqrestore(&amd_lock, flags);
+       }
+-      return ret;
++      return need_pll_quirk;
+ }
+ EXPORT_SYMBOL_GPL(usb_amd_find_chipset_info);
diff --git a/queue-4.4/usb-wusbcore-fix-unbalanced-get-put-cluster_id.patch b/queue-4.4/usb-wusbcore-fix-unbalanced-get-put-cluster_id.patch
new file mode 100644 (file)
index 0000000..ab91c18
--- /dev/null
@@ -0,0 +1,61 @@
+From f90bf1ece48a736097ea224430578fe586a9544c Mon Sep 17 00:00:00 2001
+From: Phong Tran <tranmanphong@gmail.com>
+Date: Wed, 24 Jul 2019 09:06:01 +0700
+Subject: usb: wusbcore: fix unbalanced get/put cluster_id
+
+From: Phong Tran <tranmanphong@gmail.com>
+
+commit f90bf1ece48a736097ea224430578fe586a9544c upstream.
+
+syzboot reported that
+https://syzkaller.appspot.com/bug?extid=fd2bd7df88c606eea4ef
+
+There is not consitency parameter in cluste_id_get/put calling.
+In case of getting the id with result is failure, the wusbhc->cluster_id
+will not be updated and this can not be used for wusb_cluster_id_put().
+
+Tested report
+https://groups.google.com/d/msg/syzkaller-bugs/0znZopp3-9k/oxOrhLkLEgAJ
+
+Reproduce and gdb got the details:
+
+139            addr = wusb_cluster_id_get();
+(gdb) n
+140            if (addr == 0)
+(gdb) print addr
+$1 = 254 '\376'
+(gdb) n
+142            result = __hwahc_set_cluster_id(hwahc, addr);
+(gdb) print result
+$2 = -71
+(gdb) break wusb_cluster_id_put
+Breakpoint 3 at 0xffffffff836e3f20: file drivers/usb/wusbcore/wusbhc.c, line 384.
+(gdb) s
+Thread 2 hit Breakpoint 3, wusb_cluster_id_put (id=0 '\000') at drivers/usb/wusbcore/wusbhc.c:384
+384            id = 0xff - id;
+(gdb) n
+385            BUG_ON(id >= CLUSTER_IDS);
+(gdb) print id
+$3 = 255 '\377'
+
+Reported-by: syzbot+fd2bd7df88c606eea4ef@syzkaller.appspotmail.com
+Signed-off-by: Phong Tran <tranmanphong@gmail.com>
+Cc: stable <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20190724020601.15257-1-tranmanphong@gmail.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/usb/host/hwa-hc.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/usb/host/hwa-hc.c
++++ b/drivers/usb/host/hwa-hc.c
+@@ -173,7 +173,7 @@ out:
+       return result;
+ error_set_cluster_id:
+-      wusb_cluster_id_put(wusbhc->cluster_id);
++      wusb_cluster_id_put(addr);
+ error_cluster_id_get:
+       goto out;
diff --git a/queue-4.4/x86-speculation-mds-apply-more-accurate-check-on-hypervisor-platform.patch b/queue-4.4/x86-speculation-mds-apply-more-accurate-check-on-hypervisor-platform.patch
new file mode 100644 (file)
index 0000000..b476032
--- /dev/null
@@ -0,0 +1,39 @@
+From 517c3ba00916383af6411aec99442c307c23f684 Mon Sep 17 00:00:00 2001
+From: Zhenzhong Duan <zhenzhong.duan@oracle.com>
+Date: Thu, 25 Jul 2019 10:39:09 +0800
+Subject: x86/speculation/mds: Apply more accurate check on hypervisor platform
+
+From: Zhenzhong Duan <zhenzhong.duan@oracle.com>
+
+commit 517c3ba00916383af6411aec99442c307c23f684 upstream.
+
+X86_HYPER_NATIVE isn't accurate for checking if running on native platform,
+e.g. CONFIG_HYPERVISOR_GUEST isn't set or "nopv" is enabled.
+
+Checking the CPU feature bit X86_FEATURE_HYPERVISOR to determine if it's
+running on native platform is more accurate.
+
+This still doesn't cover the platforms on which X86_FEATURE_HYPERVISOR is
+unsupported, e.g. VMware, but there is nothing which can be done about this
+scenario.
+
+Fixes: 8a4b06d391b0 ("x86/speculation/mds: Add sysfs reporting for MDS")
+Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: stable@vger.kernel.org
+Link: https://lkml.kernel.org/r/1564022349-17338-1-git-send-email-zhenzhong.duan@oracle.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+diff --git a/arch/x86/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c
+index 66ca906aa790..801ecd1c3fd5 100644
+--- a/arch/x86/kernel/cpu/bugs.c
++++ b/arch/x86/kernel/cpu/bugs.c
+@@ -1226,7 +1226,7 @@ static ssize_t l1tf_show_state(char *buf)
+ static ssize_t mds_show_state(char *buf)
+ {
+-      if (!hypervisor_is_type(X86_HYPER_NATIVE)) {
++      if (boot_cpu_has(X86_FEATURE_HYPERVISOR)) {
+               return sprintf(buf, "%s; SMT Host state unknown\n",
+                              mds_strings[mds_mitigation]);
+       }
diff --git a/queue-4.4/x86-sysfb_efi-add-quirks-for-some-devices-with-swapped-width-and-height.patch b/queue-4.4/x86-sysfb_efi-add-quirks-for-some-devices-with-swapped-width-and-height.patch
new file mode 100644 (file)
index 0000000..7ef28b3
--- /dev/null
@@ -0,0 +1,91 @@
+From d02f1aa39189e0619c3525d5cd03254e61bf606a Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Sun, 21 Jul 2019 17:24:18 +0200
+Subject: x86/sysfb_efi: Add quirks for some devices with swapped width and height
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit d02f1aa39189e0619c3525d5cd03254e61bf606a upstream.
+
+Some Lenovo 2-in-1s with a detachable keyboard have a portrait screen but
+advertise a landscape resolution and pitch, resulting in a messed up
+display if the kernel tries to show anything on the efifb (because of the
+wrong pitch).
+
+Fix this by adding a new DMI match table for devices which need to have
+their width and height swapped.
+
+At first it was tried to use the existing table for overriding some of the
+efifb parameters, but some of the affected devices have variants with
+different LCD resolutions which will not work with hardcoded override
+values.
+
+Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1730783
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: stable@vger.kernel.org
+Link: https://lkml.kernel.org/r/20190721152418.11644-1-hdegoede@redhat.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/sysfb_efi.c |   46 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 46 insertions(+)
+
+--- a/arch/x86/kernel/sysfb_efi.c
++++ b/arch/x86/kernel/sysfb_efi.c
+@@ -216,9 +216,55 @@ static const struct dmi_system_id efifb_
+       {},
+ };
++/*
++ * Some devices have a portrait LCD but advertise a landscape resolution (and
++ * pitch). We simply swap width and height for these devices so that we can
++ * correctly deal with some of them coming with multiple resolutions.
++ */
++static const struct dmi_system_id efifb_dmi_swap_width_height[] __initconst = {
++      {
++              /*
++               * Lenovo MIIX310-10ICR, only some batches have the troublesome
++               * 800x1280 portrait screen. Luckily the portrait version has
++               * its own BIOS version, so we match on that.
++               */
++              .matches = {
++                      DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
++                      DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "MIIX 310-10ICR"),
++                      DMI_EXACT_MATCH(DMI_BIOS_VERSION, "1HCN44WW"),
++              },
++      },
++      {
++              /* Lenovo MIIX 320-10ICR with 800x1280 portrait screen */
++              .matches = {
++                      DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
++                      DMI_EXACT_MATCH(DMI_PRODUCT_VERSION,
++                                      "Lenovo MIIX 320-10ICR"),
++              },
++      },
++      {
++              /* Lenovo D330 with 800x1280 or 1200x1920 portrait screen */
++              .matches = {
++                      DMI_EXACT_MATCH(DMI_SYS_VENDOR, "LENOVO"),
++                      DMI_EXACT_MATCH(DMI_PRODUCT_VERSION,
++                                      "Lenovo ideapad D330-10IGM"),
++              },
++      },
++      {},
++};
++
+ __init void sysfb_apply_efi_quirks(void)
+ {
+       if (screen_info.orig_video_isVGA != VIDEO_TYPE_EFI ||
+           !(screen_info.capabilities & VIDEO_CAPABILITY_SKIP_QUIRKS))
+               dmi_check_system(efifb_dmi_system_table);
++
++      if (screen_info.orig_video_isVGA == VIDEO_TYPE_EFI &&
++          dmi_check_system(efifb_dmi_swap_width_height)) {
++              u16 temp = screen_info.lfb_width;
++
++              screen_info.lfb_width = screen_info.lfb_height;
++              screen_info.lfb_height = temp;
++              screen_info.lfb_linelength = 4 * screen_info.lfb_width;
++      }
+ }