Commit 237d5bd7 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] slab poisoning fix

The slab debugging code is supposed to poison freshly-allocated obejcts with
0x5a and freed ones with 0x6b, so we can distinguish use-uninitialised from
use-after-free.

It wasn't working right for recycled objects.  Fix.
parent 919a670d
......@@ -1745,8 +1745,10 @@ cache_alloc_debugcheck_after(kmem_cache_t *cachep,
if (!objp)
return objp;
if (cachep->flags & SLAB_POISON)
if (cachep->flags & SLAB_POISON) {
check_poison_obj(cachep, objp);
poison_obj(cachep, objp, POISON_BEFORE);
}
if (cachep->flags & SLAB_STORE_USER) {
objlen -= BYTES_PER_WORD;
*((void **)(objp+objlen)) = caller;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment