508411e
Bugzilla: 1090746
508411e
Upstream-status: Queued for 3.15 and CC'd to stable
508411e
508411e
From 2bb09843fc720389082ce7834b2716254bdf6c2d Mon Sep 17 00:00:00 2001
508411e
Message-Id: <2bb09843fc720389082ce7834b2716254bdf6c2d.1397794898.git.lv.zheng@intel.com>
508411e
From: Lv Zheng <lv.zheng@intel.com>
508411e
Date: Fri, 18 Apr 2014 12:21:34 +0800
508411e
Subject: [PATCH] ACPICA: Tables: Fix a bad pointer issue in
508411e
 acpi_tb_parse_root_table().
508411e
508411e
The following is a linuxizing generation of the ACPICA commit to back ports
508411e
Linux XSDT validation mechanism to ACPICA:
508411e
  Commit: 671cc68dc61f029d44b43a681356078e02d8dab8
508411e
  Subject: ACPICA: Back port and refine validation of the XSDT root table.
508411e
It triggers a regression that a pointer is still used after unmapping.
508411e
508411e
This patch fixes this issue. Lv Zheng.
508411e
508411e
Buglink: https://bugzilla.kernel.org/show_bug.cgi?id=73911
508411e
Buglink: https://bugs.archlinux.org/task/39811
508411e
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
508411e
Reported-and-tested-by: Bruce Chiarelli <mano155@gmail.com>
508411e
Reported-and-tested-by: Spyros Stathopoulos <spystath@gmail.com>
508411e
Cc: <stable@vger.kernel.org> # 3.14.x: 671cc68: ACPICA: Back port and refine validation of the XSDT root table.
508411e
---
508411e
 drivers/acpi/acpica/tbutils.c |    6 ++++--
508411e
 1 file changed, 4 insertions(+), 2 deletions(-)
508411e
508411e
diff --git a/drivers/acpi/acpica/tbutils.c b/drivers/acpi/acpica/tbutils.c
508411e
index 6412d3c..7285871 100644
508411e
--- a/drivers/acpi/acpica/tbutils.c
508411e
+++ b/drivers/acpi/acpica/tbutils.c
508411e
@@ -461,6 +461,7 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
508411e
 	u32 table_count;
508411e
 	struct acpi_table_header *table;
508411e
 	acpi_physical_address address;
508411e
+	acpi_physical_address rsdt_address;
508411e
 	u32 length;
508411e
 	u8 *table_entry;
508411e
 	acpi_status status;
508411e
@@ -488,11 +489,13 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
508411e
 		 * as per the ACPI specification.
508411e
 		 */
508411e
 		address = (acpi_physical_address) rsdp->xsdt_physical_address;
508411e
+		rsdt_address = (acpi_physical_address) rsdp->rsdt_physical_address;
508411e
 		table_entry_size = ACPI_XSDT_ENTRY_SIZE;
508411e
 	} else {
508411e
 		/* Root table is an RSDT (32-bit physical addresses) */
508411e
 
508411e
 		address = (acpi_physical_address) rsdp->rsdt_physical_address;
508411e
+		rsdt_address = address;
508411e
 		table_entry_size = ACPI_RSDT_ENTRY_SIZE;
508411e
 	}
508411e
 
508411e
@@ -515,8 +518,7 @@ acpi_status __init acpi_tb_parse_root_table(acpi_physical_address rsdp_address)
508411e
 
508411e
 			/* Fall back to the RSDT */
508411e
 
508411e
-			address =
508411e
-			    (acpi_physical_address) rsdp->rsdt_physical_address;
508411e
+			address = rsdt_address;
508411e
 			table_entry_size = ACPI_RSDT_ENTRY_SIZE;
508411e
 		}
508411e
 	}
508411e
-- 
508411e
1.7.10
508411e