On Wed, 23 May 2012, JoonSoo Kim wrote:
2012/5/19 Christoph Lameter [off-list ref]:
quoted
This patch has the effect of adding sanity checks for SLUB and SLOB
under CONFIG_DEBUG_VM and removes the checks in SLAB for !CONFIG_DEBUG_VM.
If !CONFIG_DEBUG_VM,
code for sanity checks remain in __kmem_cache_create in slab.c, doesn't it?
Some sanity checks remain after this patch and are moved later.
quoted
+#ifdef CONFIG_DEBUG_VM
+ if (!name || in_interrupt() || size < sizeof(void *) ||
+ size > KMALLOC_MAX_SIZE) {
+ printk(KERN_ERR "kmem_cache_create(%s) integrity check"
+ " failed\n", name);
+ goto out;
+ }
+#endif
Currently, when !CONFIG_DEBUG_VM, name check is handled differently in
sl[aou]bs.
slob worked with !name, but slab, slub return NULL.
So I think some change is needed for name handling.
Right. All should check for !name and fail on that.