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-next>] [day] [month] [year] [list]
Message-Id: <1453385113-23034-1-git-send-email-pure.logic@nexus-software.ie>
Date:	Thu, 21 Jan 2016 14:05:13 +0000
From:	Bryan O'Donoghue <pure.logic@...us-software.ie>
To:	x86@...nel.org, linux-kernel@...r.kernel.org,
	stable@...r.kernel.org
Cc:	Bryan O'Donoghue <pure.logic@...us-software.ie>
Subject: [PATCH] x86/intel/quark: Remove lock bit around kernel IMR

Currently when setting up an IMR around the kernel .text area we lock that
IMR, preventing further modification. While superficially this appears to
be the right thing to do, in fact this doesn't account for a legitimate
change in the memory map such as when running through kexec. In such a
scenario a second kernel can have a different size and location to it's
predecessor and can view some of the memory occupied by its predecessor as
legitimately usable RAM. This RAM can then be allocated to DMA agents
within the system and trigger an IMR violation.

The solution to this situation is to keep the kernel .text section IMR lock
bit false. This means that a subsequent kernel will boot and can tear-down
an existing IMR, while still setting up an IMR around its own .text
section.

Signed-off-by: Bryan O'Donoghue <pure.logic@...us-software.ie>
Reported-by: Andriy Shevchenko <andriy.shevchenko@...el.com>
---
 arch/x86/platform/intel-quark/imr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/platform/intel-quark/imr.c b/arch/x86/platform/intel-quark/imr.c
index c1bdafa..1c43639 100644
--- a/arch/x86/platform/intel-quark/imr.c
+++ b/arch/x86/platform/intel-quark/imr.c
@@ -591,7 +591,7 @@ static void __init imr_fixup_memmap(struct imr_device *idev)
 	 * from the beginning of the .text secton to the end of the
 	 * .rodata section as one physically contiguous block.
 	 */
-	ret = imr_add_range(base, size, IMR_CPU, IMR_CPU, true);
+	ret = imr_add_range(base, size, IMR_CPU, IMR_CPU, false);
 	if (ret < 0) {
 		pr_err("unable to setup IMR for kernel: (%p - %p)\n",
 			&_text, &__end_rodata);
-- 
2.5.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ