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-next>] [day] [month] [year] [list]
Date:	Mon, 31 Aug 2009 15:42:21 +0800
From:	Wu Fengguang <fengguang.wu@...el.com>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Nick Piggin <nickpiggin@...oo.com.au>,
	Christoph Lameter <cl@...ux-foundation.org>, linux-mm@...ck.org
Subject: [PATCH] slqb: add common slab debug bits

This is a simple copy&paste from slub.c:

- lockdep annotation
- might sleep annotation
- fault injection

CC: Nick Piggin <nickpiggin@...oo.com.au>
CC: Christoph Lameter <cl@...ux-foundation.org>
Signed-off-by: Wu Fengguang <fengguang.wu@...el.com>
---
 mm/slqb.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- linux-mm.orig/mm/slqb.c	2009-08-28 15:51:15.000000000 +0800
+++ linux-mm/mm/slqb.c	2009-08-28 16:05:33.000000000 +0800
@@ -19,6 +19,7 @@
 #include <linux/ctype.h>
 #include <linux/kallsyms.h>
 #include <linux/memory.h>
+#include <linux/fault-inject.h>
 
 /*
  * TODO
@@ -1541,6 +1542,12 @@ static __always_inline void *slab_alloc(
 
 	gfpflags &= gfp_allowed_mask;
 
+	lockdep_trace_alloc(gfpflags);
+	might_sleep_if(gfpflags & __GFP_WAIT);
+
+	if (should_failslab(s->objsize, gfpflags))
+		return NULL;
+
 again:
 	local_irq_save(flags);
 	object = __slab_alloc(s, gfpflags, node);
--
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