]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Dec 2019 21:16:46 +0000 (22:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Dec 2019 21:16:46 +0000 (22:16 +0100)
added patches:
platform-x86-hp-wmi-fix-acpi-errors-caused-by-too-small-buffer.patch

queue-4.9/platform-x86-hp-wmi-fix-acpi-errors-caused-by-too-small-buffer.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/platform-x86-hp-wmi-fix-acpi-errors-caused-by-too-small-buffer.patch b/queue-4.9/platform-x86-hp-wmi-fix-acpi-errors-caused-by-too-small-buffer.patch
new file mode 100644 (file)
index 0000000..843990d
--- /dev/null
@@ -0,0 +1,70 @@
+From 16245db1489cd9aa579506f64afeeeb13d825a93 Mon Sep 17 00:00:00 2001
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Fri, 22 Nov 2019 19:56:40 +0100
+Subject: platform/x86: hp-wmi: Fix ACPI errors caused by too small buffer
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+commit 16245db1489cd9aa579506f64afeeeb13d825a93 upstream.
+
+The HP WMI calls may take up to 128 bytes of data as input, and
+the AML methods implementing the WMI calls, declare a couple of fields for
+accessing input in different sizes, specifycally the HWMC method contains:
+
+        CreateField (Arg1, 0x80, 0x0400, D128)
+
+Even though we do not use any of the WMI command-types which need a buffer
+of this size, the APCI interpreter still tries to create it as it is
+declared in generoc code at the top of the HWMC method which runs before
+the code looks at which command-type is requested.
+
+This results in many of these errors on many different HP laptop models:
+
+[   14.459261] ACPI Error: Field [D128] at 1152 exceeds Buffer [NULL] size 160 (bits) (20170303/dsopcode-236)
+[   14.459268] ACPI Error: Method parse/execution failed [\HWMC] (Node ffff8edcc61507f8), AE_AML_BUFFER_LIMIT (20170303/psparse-543)
+[   14.459279] ACPI Error: Method parse/execution failed [\_SB.WMID.WMAA] (Node ffff8edcc61523c0), AE_AML_BUFFER_LIMIT (20170303/psparse-543)
+
+This commit increases the size of the data element of the bios_args struct
+to 128 bytes fixing these errors.
+
+Cc: stable@vger.kernel.org
+BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=197007
+BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=201981
+BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1520703
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/platform/x86/hp-wmi.c |    6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/platform/x86/hp-wmi.c
++++ b/drivers/platform/x86/hp-wmi.c
+@@ -90,7 +90,7 @@ struct bios_args {
+       u32 command;
+       u32 commandtype;
+       u32 datasize;
+-      u32 data;
++      u8 data[128];
+ };
+ struct bios_return {
+@@ -198,7 +198,7 @@ static int hp_wmi_perform_query(int quer
+               .command = write ? 0x2 : 0x1,
+               .commandtype = query,
+               .datasize = insize,
+-              .data = 0,
++              .data = { 0 },
+       };
+       struct acpi_buffer input = { sizeof(struct bios_args), &args };
+       struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
+@@ -206,7 +206,7 @@ static int hp_wmi_perform_query(int quer
+       if (WARN_ON(insize > sizeof(args.data)))
+               return -EINVAL;
+-      memcpy(&args.data, buffer, insize);
++      memcpy(&args.data[0], buffer, insize);
+       wmi_evaluate_method(HPWMI_BIOS_GUID, 0, 0x3, &input, &output);
index ad95909b7f5483743792ddc55de7345221ba0c1d..61375b1c61764e4cc2f5434bc24b439d6cfdc37a 100644 (file)
@@ -121,3 +121,4 @@ sctp-cache-netns-in-sctp_ep_common.patch
 net-sched-fix-tc-s-class-show-no-bstats-on-class-with-nolock-subqueues.patch
 hid-core-check-whether-usage-page-item-is-after-usage-id-items.patch
 hwrng-stm32-fix-unbalanced-pm_runtime_enable.patch
+platform-x86-hp-wmi-fix-acpi-errors-caused-by-too-small-buffer.patch