Skip to contentSkip to conversation

Taint kernel when we detect a corrupted slab.

PATCH Applied Dave Jones 4 participants 6 messages Sep 18, 2012 – Sep 19, 2012

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

It doesn't seem worth adding a new taint flag for this, so just re-use the one from 'bad page'

mm/slub.c +2 -0
index 2fdd96f..0c5009d 100644
@@ -568,6 +568,8 @@ static void slab_bug(struct kmem_cache *s, char *fmt, ...)
 	printk(KERN_ERR "BUG %s (%s): %s\n", s->name, print_tainted(), buf);
 	printk(KERN_ERR "----------------------------------------"
 			"-------------------------------------\n\n");
+
+	add_taint(TAINT_BAD_PAGE);
 }
 
 static void slab_fix(struct kmem_cache *s, char *fmt, ...)
#2 lore raw
Quoted 6 lines · Christoph Lameter
Quoted 2 lines · Dave Jones

It doesn't seem worth adding a new taint flag for this, so just re-use the one from 'bad page'

[Fixing Pekka's email address]

Dave, would you like to add something similar to __slab_error() for CONFIG_SLAB?

author
#3 lore raw
Quoted 7 lines · David Rientjes
Quoted 5 lines · Christoph Lameter
Quoted 2 lines · Dave Jones

It doesn't seem worth adding a new taint flag for this, so just re-use the one from 'bad page'

Quoted 6 lines
Quoted 1 line

[Fixing Pekka's email address]

Dave, would you like to add something similar to __slab_error() for CONFIG_SLAB?

Sure. This ?

Dave

Signature · 6 lines
Taint kernel when we detect a corrupted slab.

It doesn't seem worth adding a new taint flag for this, so just re-use
the one from 'bad page'

Signed-off-by: Dave Jones <[email protected]>
mm/slub.c +2 -0
index 2fdd96f..0c5009d 100644
@@ -568,6 +568,8 @@ static void slab_bug(struct kmem_cache *s, char *fmt, ...)
 	printk(KERN_ERR "BUG %s (%s): %s\n", s->name, print_tainted(), buf);
 	printk(KERN_ERR "----------------------------------------"
 			"-------------------------------------\n\n");
+
+	add_taint(TAINT_BAD_PAGE);
 }
 
 static void slab_fix(struct kmem_cache *s, char *fmt, ...)
mm/slab.c +1 -0
index c685475..cbce8c9 100644
@@ -818,6 +818,7 @@ static void __slab_error(const char *function, struct kmem_cache *cachep,
 	printk(KERN_ERR "slab error in %s(): cache `%s': %s\n",
 	       function, cachep->name, msg);
 	dump_stack();
+	add_taint(TAINT_BAD_PAGE);
 }
 
 /*