lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-5a949b38839e284b1307540c56b03caf57da9736@git.kernel.org>
Date:   Mon, 10 Jun 2019 13:07:59 -0700
From:   tip-bot for Kairui Song <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     rjw@...ysocki.net, bp@...e.de, dyoung@...hat.com,
        j-nomura@...jp.nec.com, linux-kernel@...r.kernel.org,
        kasong@...hat.com, x86@...nel.org, mingo@...nel.org,
        fanc.fnst@...fujitsu.com, tglx@...utronix.de, lijiang@...hat.com,
        bhe@...hat.com, dirk.vandermerwe@...ronome.com, hpa@...or.com
Subject: [tip:x86/boot] x86/kexec: Add the ACPI NVS region to the ident map

Commit-ID:  5a949b38839e284b1307540c56b03caf57da9736
Gitweb:     https://git.kernel.org/tip/5a949b38839e284b1307540c56b03caf57da9736
Author:     Kairui Song <kasong@...hat.com>
AuthorDate: Mon, 10 Jun 2019 15:36:17 +0800
Committer:  Borislav Petkov <bp@...e.de>
CommitDate: Mon, 10 Jun 2019 22:00:26 +0200

x86/kexec: Add the ACPI NVS region to the ident map

With the recent addition of RSDP parsing in the decompression stage,
a kexec-ed kernel now needs ACPI tables to be covered by the identity
mapping. And in commit

  6bbeb276b71f ("x86/kexec: Add the EFI system tables and ACPI tables to the ident map")

the ACPI tables memory region was added to the ident map.

But some machines have only an ACPI NVS memory region and the ACPI
tables are located in that region. In such case, the kexec-ed kernel
will still fail when trying to access ACPI tables if they're not mapped.

So add the NVS memory region to the ident map as well.

 [ bp: Massage. ]

Fixes: 6bbeb276b71f ("x86/kexec: Add the EFI system tables and ACPI tables to the ident map")
Suggested-by: Junichi Nomura <j-nomura@...jp.nec.com>
Signed-off-by: Kairui Song <kasong@...hat.com>
Signed-off-by: Borislav Petkov <bp@...e.de>
Tested-by: Junichi Nomura <j-nomura@...jp.nec.com>
Cc: Baoquan He <bhe@...hat.com>
Cc: Chao Fan <fanc.fnst@...fujitsu.com>
Cc: Dave Young <dyoung@...hat.com>
Cc: Dirk van der Merwe <dirk.vandermerwe@...ronome.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: Ingo Molnar <mingo@...nel.org>
Cc: kexec@...ts.infradead.org
Cc: Lianbo Jiang <lijiang@...hat.com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: x86-ml <x86@...nel.org>
Link: https://lkml.kernel.org/r/20190610073617.19767-1-kasong@redhat.com
---
 arch/x86/kernel/machine_kexec_64.c | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 3c77bdf7b32a..b2b88dcaaf88 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -54,14 +54,26 @@ static int mem_region_callback(struct resource *res, void *arg)
 static int
 map_acpi_tables(struct x86_mapping_info *info, pgd_t *level4p)
 {
-	unsigned long flags = IORESOURCE_MEM | IORESOURCE_BUSY;
 	struct init_pgtable_data data;
+	unsigned long flags;
+	int ret;
 
 	data.info = info;
 	data.level4p = level4p;
 	flags = IORESOURCE_MEM | IORESOURCE_BUSY;
-	return walk_iomem_res_desc(IORES_DESC_ACPI_TABLES, flags, 0, -1,
-				   &data, mem_region_callback);
+
+	ret = walk_iomem_res_desc(IORES_DESC_ACPI_TABLES, flags, 0, -1,
+				  &data, mem_region_callback);
+	if (ret && ret != -EINVAL)
+		return ret;
+
+	/* ACPI tables could be located in ACPI Non-volatile Storage region */
+	ret = walk_iomem_res_desc(IORES_DESC_ACPI_NV_STORAGE, flags, 0, -1,
+				  &data, mem_region_callback);
+	if (ret && ret != -EINVAL)
+		return ret;
+
+	return 0;
 }
 #else
 static int map_acpi_tables(struct x86_mapping_info *info, pgd_t *level4p) { return 0; }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ