]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.35/acpica-namespace-remove-address-node-from-global-list-after-method-termination.patch
Linux 4.19.35
[thirdparty/kernel/stable-queue.git] / releases / 4.19.35 / acpica-namespace-remove-address-node-from-global-list-after-method-termination.patch
CommitLineData
948f2681
GKH
1From c5781ffbbd4f742a58263458145fe7f0ac01d9e0 Mon Sep 17 00:00:00 2001
2From: Erik Schmauss <erik.schmauss@intel.com>
3Date: Mon, 8 Apr 2019 13:42:26 -0700
4Subject: ACPICA: Namespace: remove address node from global list after method termination
5
6From: Erik Schmauss <erik.schmauss@intel.com>
7
8commit c5781ffbbd4f742a58263458145fe7f0ac01d9e0 upstream.
9
10ACPICA commit b233720031a480abd438f2e9c643080929d144c3
11
12ASL operation_regions declare a range of addresses that it uses. In a
13perfect world, the range of addresses should be used exclusively by
14the AML interpreter. The OS can use this information to decide which
15drivers to load so that the AML interpreter and device drivers use
16different regions of memory.
17
18During table load, the address information is added to a global
19address range list. Each node in this list contains an address range
20as well as a namespace node of the operation_region. This list is
21deleted at ACPI shutdown.
22
23Unfortunately, ASL operation_regions can be declared inside of control
24methods. Although this is not recommended, modern firmware contains
25such code. New module level code changes unintentionally removed the
26functionality of adding and removing nodes to the global address
27range list.
28
29A few months ago, support for adding addresses has been re-
30implemented. However, the removal of the address range list was
31missed and resulted in some systems to crash due to the address list
32containing bogus namespace nodes from operation_regions declared in
33control methods. In order to fix the crash, this change removes
34dynamic operation_regions after control method termination.
35
36Link: https://github.com/acpica/acpica/commit/b2337200
37Link: https://bugzilla.kernel.org/show_bug.cgi?id=202475
38Fixes: 4abb951b73ff ("ACPICA: AML interpreter: add region addresses in global list during initialization")
39Reported-by: Michael J Gruber <mjg@fedoraproject.org>
40Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
41Signed-off-by: Bob Moore <robert.moore@intel.com>
42Cc: 4.20+ <stable@vger.kernel.org> # 4.20+
43Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
44Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
45
46---
47 drivers/acpi/acpica/nsobject.c | 4 ++++
48 1 file changed, 4 insertions(+)
49
50--- a/drivers/acpi/acpica/nsobject.c
51+++ b/drivers/acpi/acpica/nsobject.c
52@@ -186,6 +186,10 @@ void acpi_ns_detach_object(struct acpi_n
53 }
54 }
55
56+ if (obj_desc->common.type == ACPI_TYPE_REGION) {
57+ acpi_ut_remove_address_range(obj_desc->region.space_id, node);
58+ }
59+
60 /* Clear the Node entry in all cases */
61
62 node->object = NULL;