]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.35/acpica-namespace-remove-address-node-from-global-list-after-method-termination.patch
Linux 4.14.112
[thirdparty/kernel/stable-queue.git] / releases / 4.19.35 / acpica-namespace-remove-address-node-from-global-list-after-method-termination.patch
1 From c5781ffbbd4f742a58263458145fe7f0ac01d9e0 Mon Sep 17 00:00:00 2001
2 From: Erik Schmauss <erik.schmauss@intel.com>
3 Date: Mon, 8 Apr 2019 13:42:26 -0700
4 Subject: ACPICA: Namespace: remove address node from global list after method termination
5
6 From: Erik Schmauss <erik.schmauss@intel.com>
7
8 commit c5781ffbbd4f742a58263458145fe7f0ac01d9e0 upstream.
9
10 ACPICA commit b233720031a480abd438f2e9c643080929d144c3
11
12 ASL operation_regions declare a range of addresses that it uses. In a
13 perfect world, the range of addresses should be used exclusively by
14 the AML interpreter. The OS can use this information to decide which
15 drivers to load so that the AML interpreter and device drivers use
16 different regions of memory.
17
18 During table load, the address information is added to a global
19 address range list. Each node in this list contains an address range
20 as well as a namespace node of the operation_region. This list is
21 deleted at ACPI shutdown.
22
23 Unfortunately, ASL operation_regions can be declared inside of control
24 methods. Although this is not recommended, modern firmware contains
25 such code. New module level code changes unintentionally removed the
26 functionality of adding and removing nodes to the global address
27 range list.
28
29 A few months ago, support for adding addresses has been re-
30 implemented. However, the removal of the address range list was
31 missed and resulted in some systems to crash due to the address list
32 containing bogus namespace nodes from operation_regions declared in
33 control methods. In order to fix the crash, this change removes
34 dynamic operation_regions after control method termination.
35
36 Link: https://github.com/acpica/acpica/commit/b2337200
37 Link: https://bugzilla.kernel.org/show_bug.cgi?id=202475
38 Fixes: 4abb951b73ff ("ACPICA: AML interpreter: add region addresses in global list during initialization")
39 Reported-by: Michael J Gruber <mjg@fedoraproject.org>
40 Signed-off-by: Erik Schmauss <erik.schmauss@intel.com>
41 Signed-off-by: Bob Moore <robert.moore@intel.com>
42 Cc: 4.20+ <stable@vger.kernel.org> # 4.20+
43 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
44 Signed-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;