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]
Date:	Sat, 7 Jun 2008 16:32:42 +0200
From:	Vegard Nossum <vegard.nossum@...il.com>
To:	Pekka Enberg <penberg@...helsinki.fi>, Ingo Molnar <mingo@...e.hu>
Cc:	Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org
Subject: [PATCH] kmemcheck: don't track pages allocated with interrupts
	disabled

Hi,

It seems that I was wrong regarding the set_memory_4k() approach. It seems
to only have worked because we were lucky. We may later reinstate the code
to disable PSE, but this time not unconditionally, perhaps with a config
option or boot-time option.

That a new page needs to be allocated with interrupts disabled is probably
rare enough that we can get away with this without losing too many pages
that could otherwise have been tracked.

Again, this is overall nicer than unconditionally disabling PSE, since
that incurs a much larger overhead in the case where kmemcheck is enabled
in the config but disabled by default. (Ingo, you previously indicated that
it would be nice if kernels could be configured in this way by default.)


Vegard


From: Vegard Nossum <vegardno@....ifi.uio.no>
Date: Sat, 7 Jun 2008 16:18:29 +0200
Subject: [PATCH] kmemcheck: don't track pages allocated with interrupts disabled

Because large physical pages need to be split to 4k-sized pages after
the slab page has been allocated, and this needs to flush the page
tables, we cannot track any pages that were allocated while interrupts
were disabled.

This fixes a boot crash that seems to depend on timing to appear.

Signed-off-by: Vegard Nossum <vegardno@....ifi.uio.no>
---
 mm/kmemcheck.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/mm/kmemcheck.c b/mm/kmemcheck.c
index 4efdf1e..b337374 100644
--- a/mm/kmemcheck.c
+++ b/mm/kmemcheck.c
@@ -10,6 +10,14 @@ void kmemcheck_alloc_shadow(struct kmem_cache *s, gfp_t flags, int node,
 	int pages;
 	int i;
 
+	/*
+	 * It's sad, but it's true. If interrupts are enabled while making
+	 * this allocation, it means that we can't split the large page
+	 * because it would require flushing the page tables.
+	 */
+	if (irqs_disabled())
+		return;
+
 	pages = 1 << order;
 
 	/*
-- 
1.5.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ