Re: [PATCH] fs: fcntl_setlease defies lease_init assumptions

From: Pekka Enberg
Date: Mon May 08 2006 - 04:31:04 EST


Hi Linus,

On 5/8/06, Linus Torvalds <torvalds@xxxxxxxx> wrote:
Ok, I was actually really surprised that we'd ever allow a non-slab page
to be free'd as a slab or kmalloc allocation, without screaming very
loudly indeed. That implies a lack of some pretty fundamental sanity
checking by default in the slab layer (I suspect slab debugging turns it
on, but even without it, that's just nasty).

Can you see if this trivial patch at least causes a honking huge
"kernel BUG" message to be triggered quickly?

page_get_cache and page_get_slab are too late. You would need to do
the check in __cache_free; otherwise the stack pointer goes to per-CPU
caches and can be given back by kmalloc(). Adding PageSlab debugging
to __cache_free is probably too much of a performance hit, though.

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