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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 8 Feb 2008 09:09:39 +0100
From:	Ingo Molnar <mingo@...e.hu>
To:	Pekka Enberg <penberg@...helsinki.fi>
Cc:	Christoph Lameter <clameter@....com>,
	Vegard Nossum <vegard.nossum@...il.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andi Kleen <andi@...stfloor.org>,
	Richard Knutsson <ricknu-0@...dent.ltu.se>
Subject: Re: [PATCH 1/2] kmemcheck v3


* Pekka Enberg <penberg@...helsinki.fi> wrote:

> On Feb 8, 2008 1:32 AM, Christoph Lameter <clameter@....com> wrote:
> > But the slab layer allocates pages < PAGE_SIZE. You need to take a 
> > fault right? So each object would need its own page?
> 
> No. We allocate a shadow page for each data page which we then use as 
> a per-byte "bitmap." For every tracked _page_ we take the page fault 
> always.

it should also be made clear that not only does kmemcheck consume half 
of the RAM to do byte granular tracking of the other half of RAM, it's 
also slow, very slow, because almost every kernel-space instruction will 
generate a pagefault and then it will be single-stepped and it takes a 
debug fault as well.

That's of course totally crazy, but that's also OK and it's what makes 
the feature so interesting and powerful.

For example, when CONFIG_DEBUG_PAGEALLOC=y was introduced 5 years ago, 
it was almost unusable on modern hardware, due to the slowdown it gave. 
People said "twiddling ptes and flushing the TLB for every allocation, 
that's crazy!".

Today it can be enabled without noticing anything on a desktop, and it 
catches lots of nasty bugs.

The many debugging helpers Linux has are our eyes and ears - they catch 
stuff our real eyes did not catch. We need to sharpen these tools 
constantly, and do all the things that current hardware allows us to do 
sanely.

The same speedup will happen with kmemcheck as well in the long run. It 
is a big slowdown currently due to the massive amount of pagefaults it 
generates, even on top of the line hardware, but it's already fast 
enough to boot up and to catch bugs. [and we can optimize it by quite a 
degree - i've alreadyextended the profiler to trace kmemcheck pagefault 
sources.] It will never be usable in production, but the boundary of 
where to enable it and why will move constantly.

So i'm convinced that the time has come for kmemcheck. It already caught 
4 live kernel bugs and it's been tested on 2 boxes only. Please help us 
make the SLUB bits squeaky clean :-)

	Ingo
--
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