From: Greg Kroah-Hartman Date: Fri, 9 Oct 2020 07:45:19 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v4.4.239~67 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc679cc32d73e6956f83f9cd42eb8f48d3d19d98;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: platform-x86-thinkpad_acpi-initialize-tp_nvram_state-variable.patch platform-x86-thinkpad_acpi-re-initialize-acpi-buffer-size-when-reuse.patch --- diff --git a/queue-4.9/platform-x86-thinkpad_acpi-initialize-tp_nvram_state-variable.patch b/queue-4.9/platform-x86-thinkpad_acpi-initialize-tp_nvram_state-variable.patch new file mode 100644 index 00000000000..9c09d4a9968 --- /dev/null +++ b/queue-4.9/platform-x86-thinkpad_acpi-initialize-tp_nvram_state-variable.patch @@ -0,0 +1,41 @@ +From 5f38b06db8af3ed6c2fc1b427504ca56fae2eacc Mon Sep 17 00:00:00 2001 +From: Tom Rix +Date: Sun, 13 Sep 2020 12:02:03 -0700 +Subject: platform/x86: thinkpad_acpi: initialize tp_nvram_state variable + +From: Tom Rix + +commit 5f38b06db8af3ed6c2fc1b427504ca56fae2eacc upstream. + +clang static analysis flags this represenative problem +thinkpad_acpi.c:2523:7: warning: Branch condition evaluates + to a garbage value + if (!oldn->mute || + ^~~~~~~~~~~ + +In hotkey_kthread() mute is conditionally set by hotkey_read_nvram() +but unconditionally checked by hotkey_compare_and_issue_event(). +So the tp_nvram_state variable s[2] needs to be initialized. + +Fixes: 01e88f25985d ("ACPI: thinkpad-acpi: add CMOS NVRAM polling for hot keys (v9)") +Signed-off-by: Tom Rix +Reviewed-by: Hans de Goede +Acked-by: mark gross +Signed-off-by: Andy Shevchenko +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/platform/x86/thinkpad_acpi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -2476,7 +2476,7 @@ static void hotkey_compare_and_issue_eve + */ + static int hotkey_kthread(void *data) + { +- struct tp_nvram_state s[2]; ++ struct tp_nvram_state s[2] = { 0 }; + u32 poll_mask, event_mask; + unsigned int si, so; + unsigned long t; diff --git a/queue-4.9/platform-x86-thinkpad_acpi-re-initialize-acpi-buffer-size-when-reuse.patch b/queue-4.9/platform-x86-thinkpad_acpi-re-initialize-acpi-buffer-size-when-reuse.patch new file mode 100644 index 00000000000..8d4d4f4b724 --- /dev/null +++ b/queue-4.9/platform-x86-thinkpad_acpi-re-initialize-acpi-buffer-size-when-reuse.patch @@ -0,0 +1,37 @@ +From 720ef73d1a239e33c3ad8fac356b9b1348e68aaf Mon Sep 17 00:00:00 2001 +From: Aaron Ma +Date: Sat, 3 Oct 2020 01:09:16 +0800 +Subject: platform/x86: thinkpad_acpi: re-initialize ACPI buffer size when reuse + +From: Aaron Ma + +commit 720ef73d1a239e33c3ad8fac356b9b1348e68aaf upstream. + +Evaluating ACPI _BCL could fail, then ACPI buffer size will be set to 0. +When reuse this ACPI buffer, AE_BUFFER_OVERFLOW will be triggered. + +Re-initialize buffer size will make ACPI evaluate successfully. + +Fixes: 46445b6b896fd ("thinkpad-acpi: fix handle locate for video and query of _BCL") +Signed-off-by: Aaron Ma +Signed-off-by: Andy Shevchenko +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/platform/x86/thinkpad_acpi.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/platform/x86/thinkpad_acpi.c ++++ b/drivers/platform/x86/thinkpad_acpi.c +@@ -6640,8 +6640,10 @@ static int __init tpacpi_query_bcl_level + list_for_each_entry(child, &device->children, node) { + acpi_status status = acpi_evaluate_object(child->handle, "_BCL", + NULL, &buffer); +- if (ACPI_FAILURE(status)) ++ if (ACPI_FAILURE(status)) { ++ buffer.length = ACPI_ALLOCATE_BUFFER; + continue; ++ } + + obj = (union acpi_object *)buffer.pointer; + if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) { diff --git a/queue-4.9/series b/queue-4.9/series index efa54fe225e..63989d3b273 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -26,3 +26,5 @@ revert-ravb-fixed-to-be-able-to-unload-modules.patch fbcon-fix-global-out-of-bounds-read-in-fbcon_get_font.patch net-wireless-nl80211-fix-out-of-bounds-access-in-nl80211_del_key.patch usermodehelper-reset-umask-to-default-before-executing-user-process.patch +platform-x86-thinkpad_acpi-initialize-tp_nvram_state-variable.patch +platform-x86-thinkpad_acpi-re-initialize-acpi-buffer-size-when-reuse.patch