From: Greg Kroah-Hartman Date: Sun, 19 Nov 2017 11:57:12 +0000 (+0100) Subject: 4.13-stable patches X-Git-Tag: v3.18.83~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0829b0a7b3124ab05205326f0b9aea78097e4048;p=thirdparty%2Fkernel%2Fstable-queue.git 4.13-stable patches added patches: hid-cp2112-add-hidraw-dependency.patch hid-wacom-generic-recognize-wacom_hid_wd_pen-as-a-type-of-pen-collection.patch platform-x86-peaq-wmi-add-dmi-check-before-binding-to-the-wmi-interface.patch platform-x86-peaq_wmi-fix-missing-terminating-entry-for-peaq_dmi_table.patch selftests-x86-protection_keys-fix-syscall-nr-redefinition-warnings.patch x86-mce-amd-always-give-panic-severity-for-uc-errors-in-kernel-context.patch --- diff --git a/queue-4.13/hid-cp2112-add-hidraw-dependency.patch b/queue-4.13/hid-cp2112-add-hidraw-dependency.patch new file mode 100644 index 00000000000..302d099ba89 --- /dev/null +++ b/queue-4.13/hid-cp2112-add-hidraw-dependency.patch @@ -0,0 +1,37 @@ +From cde3076bdc38bf436e517a379759a9092c6ffd4f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=A9bastien=20Szymanski?= + +Date: Thu, 2 Nov 2017 12:12:43 +0100 +Subject: HID: cp2112: add HIDRAW dependency +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Sébastien Szymanski + +commit cde3076bdc38bf436e517a379759a9092c6ffd4f upstream. + +Otherwise, with HIDRAW=n, the probe function crashes because of null +dereference of hdev->hidraw. + +Fixes: 42cb6b35b9e6 ("HID: cp2112: use proper hidraw name with minor number") +Signed-off-by: Sébastien Szymanski +Acked-by: Benjamin Tissoires +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hid/Kconfig | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/hid/Kconfig ++++ b/drivers/hid/Kconfig +@@ -230,7 +230,7 @@ config HID_CMEDIA + + config HID_CP2112 + tristate "Silicon Labs CP2112 HID USB-to-SMBus Bridge support" +- depends on USB_HID && I2C && GPIOLIB ++ depends on USB_HID && HIDRAW && I2C && GPIOLIB + select GPIOLIB_IRQCHIP + ---help--- + Support for Silicon Labs CP2112 HID USB to SMBus Master Bridge. diff --git a/queue-4.13/hid-wacom-generic-recognize-wacom_hid_wd_pen-as-a-type-of-pen-collection.patch b/queue-4.13/hid-wacom-generic-recognize-wacom_hid_wd_pen-as-a-type-of-pen-collection.patch new file mode 100644 index 00000000000..3680e1e03ed --- /dev/null +++ b/queue-4.13/hid-wacom-generic-recognize-wacom_hid_wd_pen-as-a-type-of-pen-collection.patch @@ -0,0 +1,39 @@ +From 885e89f601a52cc6fb025b009df58ba83d142734 Mon Sep 17 00:00:00 2001 +From: Jason Gerecke +Date: Wed, 18 Oct 2017 08:27:13 -0700 +Subject: HID: wacom: generic: Recognize WACOM_HID_WD_PEN as a type of pen collection + +From: Jason Gerecke + +commit 885e89f601a52cc6fb025b009df58ba83d142734 upstream. + +The WACOM_PEN_FIELD macro is used to determine if a given HID field should be +associated with pen input. This field includes several known collection types +that Wacom pen data is contained in, but the WACOM_HID_WD_PEN application +collection type is notably missing. This can result in fields within this +kind of collection being completely ignored by the `wacom_usage_mapping` +function, preventing the later '*_event' functions from being notified about +changes to their value. + +Fixes: c9c095874a ("HID: wacom: generic: Support and use 'Custom HID' mode and usages") +Fixes: ac2423c975 ("HID: wacom: generic: add vendor defined touch") +Reviewed-by: Ping Cheng +Reviewed-by: Benjamin Tissoires +Signed-off-by: Jason Gerecke +Signed-off-by: Jiri Kosina +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/hid/wacom_wac.h | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/hid/wacom_wac.h ++++ b/drivers/hid/wacom_wac.h +@@ -166,6 +166,7 @@ + ((f)->physical == HID_DG_PEN) || \ + ((f)->application == HID_DG_PEN) || \ + ((f)->application == HID_DG_DIGITIZER) || \ ++ ((f)->application == WACOM_HID_WD_PEN) || \ + ((f)->application == WACOM_HID_WD_DIGITIZER) || \ + ((f)->application == WACOM_HID_G9_PEN) || \ + ((f)->application == WACOM_HID_G11_PEN)) diff --git a/queue-4.13/platform-x86-peaq-wmi-add-dmi-check-before-binding-to-the-wmi-interface.patch b/queue-4.13/platform-x86-peaq-wmi-add-dmi-check-before-binding-to-the-wmi-interface.patch new file mode 100644 index 00000000000..fa8572ddead --- /dev/null +++ b/queue-4.13/platform-x86-peaq-wmi-add-dmi-check-before-binding-to-the-wmi-interface.patch @@ -0,0 +1,71 @@ +From 3b95206110a2c13076c3a7fa8ddeae36c2dbcf42 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Thu, 5 Oct 2017 20:04:04 +0200 +Subject: platform/x86: peaq-wmi: Add DMI check before binding to the WMI interface + +From: Hans de Goede + +commit 3b95206110a2c13076c3a7fa8ddeae36c2dbcf42 upstream. + +It seems that the WMI GUID used by the PEAQ 2-in-1 WMI hotkeys is not +as unique as a GUID should be and is used on some other devices too. + +This is causing spurious key-press reports on these other devices. + +This commits adds a DMI check to the PEAQ 2-in-1 WMI hotkeys driver to +ensure that it is actually running on a PEAQ 2-in-1, fixing the +spurious key-presses on these other devices. + +BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1497861 +BugLink: https://bugzilla.suse.com/attachment.cgi?id=743182 +Signed-off-by: Hans de Goede +Signed-off-by: Andy Shevchenko +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/platform/x86/peaq-wmi.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +--- a/drivers/platform/x86/peaq-wmi.c ++++ b/drivers/platform/x86/peaq-wmi.c +@@ -8,6 +8,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -64,8 +65,22 @@ static void peaq_wmi_poll(struct input_p + } + } + ++/* Some other devices (Shuttle XS35) use the same WMI GUID for other purposes */ ++static const struct dmi_system_id peaq_dmi_table[] = { ++ { ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "PEAQ"), ++ DMI_MATCH(DMI_PRODUCT_NAME, "PEAQ PMM C1010 MD99187"), ++ }, ++ }, ++}; ++ + static int __init peaq_wmi_init(void) + { ++ /* WMI GUID is not unique, also check for a DMI match */ ++ if (!dmi_check_system(peaq_dmi_table)) ++ return -ENODEV; ++ + if (!wmi_has_guid(PEAQ_DOLBY_BUTTON_GUID)) + return -ENODEV; + +@@ -86,6 +101,9 @@ static int __init peaq_wmi_init(void) + + static void __exit peaq_wmi_exit(void) + { ++ if (!dmi_check_system(peaq_dmi_table)) ++ return; ++ + if (!wmi_has_guid(PEAQ_DOLBY_BUTTON_GUID)) + return; + diff --git a/queue-4.13/platform-x86-peaq_wmi-fix-missing-terminating-entry-for-peaq_dmi_table.patch b/queue-4.13/platform-x86-peaq_wmi-fix-missing-terminating-entry-for-peaq_dmi_table.patch new file mode 100644 index 00000000000..e05ce478add --- /dev/null +++ b/queue-4.13/platform-x86-peaq_wmi-fix-missing-terminating-entry-for-peaq_dmi_table.patch @@ -0,0 +1,31 @@ +From d6fa71f1c003fb2bc824276bb424a4171f9a717f Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Mon, 30 Oct 2017 14:07:37 +0100 +Subject: platform/x86: peaq_wmi: Fix missing terminating entry for peaq_dmi_table + +From: Hans de Goede + +commit d6fa71f1c003fb2bc824276bb424a4171f9a717f upstream. + +Add missing terminating entry to peaq_dmi_table. + +Fixes: 3b95206110a2 ("platform/x86: peaq-wmi: Add DMI check before ...") +Reported-by: Fengguang Wu +Signed-off-by: Hans de Goede +Signed-off-by: Andy Shevchenko +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/platform/x86/peaq-wmi.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/platform/x86/peaq-wmi.c ++++ b/drivers/platform/x86/peaq-wmi.c +@@ -73,6 +73,7 @@ static const struct dmi_system_id peaq_d + DMI_MATCH(DMI_PRODUCT_NAME, "PEAQ PMM C1010 MD99187"), + }, + }, ++ {} + }; + + static int __init peaq_wmi_init(void) diff --git a/queue-4.13/selftests-x86-protection_keys-fix-syscall-nr-redefinition-warnings.patch b/queue-4.13/selftests-x86-protection_keys-fix-syscall-nr-redefinition-warnings.patch new file mode 100644 index 00000000000..9cce3741161 --- /dev/null +++ b/queue-4.13/selftests-x86-protection_keys-fix-syscall-nr-redefinition-warnings.patch @@ -0,0 +1,66 @@ +From 693cb5580fdb026922363aa103add64b3ecd572e Mon Sep 17 00:00:00 2001 +From: Andy Lutomirski +Date: Sat, 4 Nov 2017 04:19:48 -0700 +Subject: selftests/x86/protection_keys: Fix syscall NR redefinition warnings + +From: Andy Lutomirski + +commit 693cb5580fdb026922363aa103add64b3ecd572e upstream. + +On new enough glibc, the pkey syscalls numbers are available. Check +first before defining them to avoid warnings like: + +protection_keys.c:198:0: warning: "SYS_pkey_alloc" redefined + +Signed-off-by: Andy Lutomirski +Cc: Borislav Petkov +Cc: Dave Hansen +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Link: http://lkml.kernel.org/r/1fbef53a9e6befb7165ff855fc1a7d4788a191d6.1509794321.git.luto@kernel.org +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + tools/testing/selftests/x86/protection_keys.c | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +--- a/tools/testing/selftests/x86/protection_keys.c ++++ b/tools/testing/selftests/x86/protection_keys.c +@@ -188,17 +188,29 @@ void lots_o_noops_around_write(int *writ + #define u64 uint64_t + + #ifdef __i386__ +-#define SYS_mprotect_key 380 +-#define SYS_pkey_alloc 381 +-#define SYS_pkey_free 382 ++ ++#ifndef SYS_mprotect_key ++# define SYS_mprotect_key 380 ++#endif ++#ifndef SYS_pkey_alloc ++# define SYS_pkey_alloc 381 ++# define SYS_pkey_free 382 ++#endif + #define REG_IP_IDX REG_EIP + #define si_pkey_offset 0x14 ++ + #else +-#define SYS_mprotect_key 329 +-#define SYS_pkey_alloc 330 +-#define SYS_pkey_free 331 ++ ++#ifndef SYS_mprotect_key ++# define SYS_mprotect_key 329 ++#endif ++#ifndef SYS_pkey_alloc ++# define SYS_pkey_alloc 330 ++# define SYS_pkey_free 331 ++#endif + #define REG_IP_IDX REG_RIP + #define si_pkey_offset 0x20 ++ + #endif + + void dump_mem(void *dumpme, int len_bytes) diff --git a/queue-4.13/series b/queue-4.13/series index 8956c00ed63..7da8da85e31 100644 --- a/queue-4.13/series +++ b/queue-4.13/series @@ -14,3 +14,9 @@ usb-serial-change-dbc-debug-device-binding-id.patch usb-serial-qcserial-add-pid-vid-for-sierra-wireless-em7355-fw-update.patch usb-serial-garmin_gps-fix-i-o-after-failed-probe-and-remove.patch usb-serial-garmin_gps-fix-memory-leak-on-probe-errors.patch +selftests-x86-protection_keys-fix-syscall-nr-redefinition-warnings.patch +x86-mce-amd-always-give-panic-severity-for-uc-errors-in-kernel-context.patch +platform-x86-peaq-wmi-add-dmi-check-before-binding-to-the-wmi-interface.patch +platform-x86-peaq_wmi-fix-missing-terminating-entry-for-peaq_dmi_table.patch +hid-cp2112-add-hidraw-dependency.patch +hid-wacom-generic-recognize-wacom_hid_wd_pen-as-a-type-of-pen-collection.patch diff --git a/queue-4.13/x86-mce-amd-always-give-panic-severity-for-uc-errors-in-kernel-context.patch b/queue-4.13/x86-mce-amd-always-give-panic-severity-for-uc-errors-in-kernel-context.patch new file mode 100644 index 00000000000..147942ba4a3 --- /dev/null +++ b/queue-4.13/x86-mce-amd-always-give-panic-severity-for-uc-errors-in-kernel-context.patch @@ -0,0 +1,67 @@ +From d65dfc81bb3894fdb68cbc74bbf5fb48d2354071 Mon Sep 17 00:00:00 2001 +From: Yazen Ghannam +Date: Mon, 6 Nov 2017 18:46:32 +0100 +Subject: x86/MCE/AMD: Always give panic severity for UC errors in kernel context + +From: Yazen Ghannam + +commit d65dfc81bb3894fdb68cbc74bbf5fb48d2354071 upstream. + +The AMD severity grading function was introduced in kernel 4.1. The +current logic can possibly give MCE_AR_SEVERITY for uncorrectable +errors in kernel context. The system may then get stuck in a loop as +memory_failure() will try to handle the bad kernel memory and find it +busy. + +Return MCE_PANIC_SEVERITY for all UC errors IN_KERNEL context on AMD +systems. + +After: + + b2f9d678e28c ("x86/mce: Check for faults tagged in EXTABLE_CLASS_FAULT exception table entries") + +was accepted in v4.6, this issue was masked because of the tail-end attempt +at kernel mode recovery in the #MC handler. + +However, uncorrectable errors IN_KERNEL context should always be considered +unrecoverable and cause a panic. + +Signed-off-by: Yazen Ghannam +Signed-off-by: Borislav Petkov +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: Tony Luck +Cc: linux-edac +Fixes: bf80bbd7dcf5 (x86/mce: Add an AMD severities-grading function) +Link: http://lkml.kernel.org/r/20171106174633.13576-1-bp@alien8.de +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/cpu/mcheck/mce-severity.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/arch/x86/kernel/cpu/mcheck/mce-severity.c ++++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c +@@ -245,6 +245,9 @@ static int mce_severity_amd(struct mce * + + if (m->status & MCI_STATUS_UC) { + ++ if (ctx == IN_KERNEL) ++ return MCE_PANIC_SEVERITY; ++ + /* + * On older systems where overflow_recov flag is not present, we + * should simply panic if an error overflow occurs. If +@@ -255,10 +258,6 @@ static int mce_severity_amd(struct mce * + if (mce_flags.smca) + return mce_severity_amd_smca(m, ctx); + +- /* software can try to contain */ +- if (!(m->mcgstatus & MCG_STATUS_RIPV) && (ctx == IN_KERNEL)) +- return MCE_PANIC_SEVERITY; +- + /* kill current process */ + return MCE_AR_SEVERITY; + } else {