]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.16.3/acpica-namespace-properly-null-terminate-objects-detached-from-a-namespace-node.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.3 / acpica-namespace-properly-null-terminate-objects-detached-from-a-namespace-node.patch
1 From e23d9b8297546c6ceb7e70771e4915f2a41733cd Mon Sep 17 00:00:00 2001
2 From: "David E. Box" <david.e.box@linux.intel.com>
3 Date: Tue, 8 Jul 2014 10:06:24 +0800
4 Subject: ACPICA: Namespace: Properly null terminate objects detached from a namespace node
5
6 From: "David E. Box" <david.e.box@linux.intel.com>
7
8 commit e23d9b8297546c6ceb7e70771e4915f2a41733cd upstream.
9
10 Fixes a bug exposed by an ACPICA unit test around the
11 acpi_attach_data()/acpi_detach_data() APIs where the failure to null
12 terminate a detached object led to the creation of a circular linked list
13 (and infinite looping) when the object is reattached.
14
15 Reported in acpica bugzilla #1063
16
17 Link: https://bugs.acpica.org/show_bug.cgi?id=1063
18 Signed-off-by: David E. Box <david.e.box@linux.intel.com>
19 Signed-off-by: Bob Moore <robert.moore@intel.com>
20 Signed-off-by: Lv Zheng <lv.zheng@intel.com>
21 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24 ---
25 drivers/acpi/acpica/nsobject.c | 11 +++++++++++
26 1 file changed, 11 insertions(+)
27
28 --- a/drivers/acpi/acpica/nsobject.c
29 +++ b/drivers/acpi/acpica/nsobject.c
30 @@ -239,6 +239,17 @@ void acpi_ns_detach_object(struct acpi_n
31 }
32 }
33
34 + /*
35 + * Detach the object from any data objects (which are still held by
36 + * the namespace node)
37 + */
38 +
39 + if (obj_desc->common.next_object &&
40 + ((obj_desc->common.next_object)->common.type ==
41 + ACPI_TYPE_LOCAL_DATA)) {
42 + obj_desc->common.next_object = NULL;
43 + }
44 +
45 /* Reset the node type to untyped */
46
47 node->type = ACPI_TYPE_ANY;