mm, sl[au]b: Taint kernel when we detect a corrupted slab
authorDave Jones <davej@redhat.com>
Tue, 18 Sep 2012 19:54:12 +0000 (15:54 -0400)
committerPekka Enberg <penberg@kernel.org>
Wed, 19 Sep 2012 07:08:01 +0000 (10:08 +0300)
It doesn't seem worth adding a new taint flag for this, so just re-use
the one from 'bad page'

Acked-by: Christoph Lameter <cl@linux.com> # SLUB
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
mm/slab.c
mm/slub.c

index cd5a92650303c251bf1b769feea8c807e85fa15b..5c6abb831e6a4eb684ffcfdc02aca4908a182398 100644 (file)
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -811,6 +811,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);
 }
 
 /*
index c67bd0a4a952bed22432e5d2a86d269bb9991bae..a6d043e1326673ea4ca4df403aacb5148aaaea42 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -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, ...)