* SLUB Debug: Fix check for super sized slabs (>512k 64bit, >256k 32bit)
@ 2007-05-18 17:16 Christoph Lameter
0 siblings, 0 replies; only message in thread
From: Christoph Lameter @ 2007-05-18 17:16 UTC (permalink / raw)
To: akpm; +Cc: linux-mm
The check for super sized slabs where we can no longer move the free
pointer behind the object for debugging purposes etc is accessing a field
that is not setup yet. We must use objsize here since the size of the slab
has not been determined yet.
The effect of this is that a global slab shrink via "slabinfo -s" will
show errors about offsets being wrong if booted with slub_debug.
Potentially there are other troubles with huge slabs under slub_debug
because the calculated free pointer offset is truncated.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
mm/slub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: slub/mm/slub.c
===================================================================
--- slub.orig/mm/slub.c 2007-05-18 10:14:05.000000000 -0700
+++ slub/mm/slub.c 2007-05-18 10:14:13.000000000 -0700
@@ -946,7 +946,7 @@ static void kmem_cache_open_debug_check(
* Debugging or ctor may create a need to move the free
* pointer. Fail if this happens.
*/
- if (s->size >= 65535 * sizeof(void *)) {
+ if (s->objsize >= 65535 * sizeof(void *)) {
BUG_ON(s->flags & (SLAB_RED_ZONE | SLAB_POISON |
SLAB_STORE_USER | SLAB_DESTROY_BY_RCU));
BUG_ON(s->ctor);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-05-18 17:16 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-18 17:16 SLUB Debug: Fix check for super sized slabs (>512k 64bit, >256k 32bit) Christoph Lameter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox