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>] [day] [month] [year] [list]
Message-Id: <20061206104951.766.40407.sendpatchset@v0>
Date:	Wed, 06 Dec 2006 02:49:51 -0800
From:	Paul Jackson <pj@....com>
To:	Andrew Morton <akpm@...l.org>, linux-kernel@...r.kernel.org
Cc:	linux-mm@...ck.org, menage@...gle.com, Paul Jackson <pj@....com>,
	clameter@....com
Subject: [PATCH] mm: fallback_alloc cpuset_zone_allowed irq fix

From: Paul Jackson <pj@....com>

fallback_alloc() could end up calling cpuset_zone_allowed()
with interrupts disabled (by code in kmem_cache_alloc_node()),
but without __GFP_HARDWALL set, leading to a possible
call of a sleeping function with interrupts disabled.

This results in the BUG report:

  BUG: sleeping function called from invalid context at kernel/cpuset.c:1520
in_atomic():0, irqs_disabled():1

Thanks to Paul Menage for catching this one.

Signed-off-by: Paul Jackson <pj@....com>

---
 mm/slab.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

--- 2.6.19-rc6-mm2.orig/mm/slab.c	2006-11-30 19:45:50.000000000 -0800
+++ 2.6.19-rc6-mm2/mm/slab.c	2006-12-05 22:41:49.000000000 -0800
@@ -3261,7 +3261,8 @@ void *fallback_alloc(struct kmem_cache *
 		int nid = zone_to_nid(*z);
 
 		if (zone_idx(*z) <= ZONE_NORMAL &&
-				cpuset_zone_allowed(*z, flags) &&
+				cpuset_zone_allowed(*z,
+					flags | __GFP_HARDWALL) &&
 				cache->nodelists[nid])
 			obj = ____cache_alloc_node(cache,
 					flags | __GFP_THISNODE, nid);

-- 
                  I won't rest till it's the best ...
                  Programmer, Linux Scalability
                  Paul Jackson <pj@....com> 1.925.600.0401
-
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