lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120918195412.GB27689@redhat.com>
Date:	Tue, 18 Sep 2012 15:54:12 -0400
From:	Dave Jones <davej@...hat.com>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Christoph Lameter <cl@...ux.com>,
	Linux Kernel <linux-kernel@...r.kernel.org>,
	Pekka Enberg <penberg@...nel.org>
Subject: Re: Taint kernel when we detect a corrupted slab.

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@...ux.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@...hat.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);
 }
 
 /*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ