Re: [patch 4/4] change slab poison pattern

From: Akinobu Mita
Date: Mon Apr 24 2006 - 06:23:47 EST


On Mon, Apr 24, 2006 at 12:20:03PM +0300, Pekka Enberg wrote:
> > Because use-after-free poisoning make kref counter signed value.
> > So this patch prevents it by changing poisoning pattern.
>
> Then why not check against POISON_INUSE when CONFIG_SLAB_DEBUG in the
> kref debugging code? I would prefer you didn't change the slab constants
> (they're well known by everyone now) but if you must, at least stick a
> big fat comment there.

This slab poisoning pattern change is not very important.

Because even if slab debugging is enalbed, kref_put() with unreferenced
kref object will be detected as slab corruption.

Because kref_put() decrements the kref counter in freed slab object.

Slab corruption: start=e0e8b698, len=32
Redzone: 0x5a2cf071/0x5a2cf071.
Last user: [<f08ea008>](release_test_kref+0x8/0x14 [test])
000: 6b 6b 6b 6b 6a 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b
^^
The main reason I want to propose this kref debugging is because
I can find many places where we can replace from atomic_t to
struct kref by doing "grep -r atomic_dec_and_test .".

But I warried that replacing by kref will just increase atomic operations
because of debugging code in kref (WARN_ON()es in kref.c)

So patch 4/4 is not very important, I want to drop patch 4/4.
-
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/