public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Jones <davej@redhat.com>
To: David Rientjes <rientjes@google.com>
Cc: Christoph Lameter <cl@linux.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Pekka Enberg <penberg@kernel.org>
Subject: Re: Taint kernel when we detect a corrupted slab.
Date: Tue, 18 Sep 2012 15:54:12 -0400	[thread overview]
Message-ID: <20120918195412.GB27689@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1209181227190.25146@chino.kir.corp.google.com>

On Tue, Sep 18, 2012 at 12:27:58PM -0700, David Rientjes wrote:
 > On Tue, 18 Sep 2012, Christoph Lameter wrote:
 > 
 > > On Tue, 18 Sep 2012, Dave Jones wrote:
 > > 
 > > > 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>
 > 
 > [Fixing Pekka's email address]
 > 
 > Dave, would you like to add something similar to __slab_error() for 
 > CONFIG_SLAB?

Sure. This ?

	Dave

-- 


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 <davej@redhat.com>

diff --git a/mm/slub.c b/mm/slub.c
index 2fdd96f..0c5009d 100644
--- 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, ...)
diff --git a/mm/slab.c b/mm/slab.c
index c685475..cbce8c9 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -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);
 }
 
 /*

  reply	other threads:[~2012-09-18 19:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-18 15:05 Taint kernel when we detect a corrupted slab Dave Jones
2012-09-18 16:57 ` Christoph Lameter
2012-09-18 19:27   ` David Rientjes
2012-09-18 19:54     ` Dave Jones [this message]
2012-09-18 20:19       ` David Rientjes
2012-09-19  7:09         ` Pekka Enberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120918195412.GB27689@redhat.com \
    --to=davej@redhat.com \
    --cc=cl@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox