Skip to content

Commit

Permalink
mm, sl[au]b: Taint kernel when we detect a corrupted slab
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dave Jones authored and penberg committed Sep 19, 2012
1 parent 947ca18 commit 645df23
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down
2 changes: 2 additions & 0 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...)
Expand Down

0 comments on commit 645df23

Please sign in to comment.