From 6857471cf3ec44101821a34c3d7dc18913d0c22b Mon Sep 17 00:00:00 2001 From: mdf Date: Wed, 28 Jul 2010 15:36:12 +0000 Subject: Add MALLOC_DEBUG_MAXZONES debug malloc(9) option to use multiple uma zones for each malloc bucket size. The purpose is to isolate different malloc types into hash classes, so that any buffer overruns or use-after-free will usually only affect memory from malloc types in that hash class. This is purely a debugging tool; by varying the hash function and tracking which hash class was corrupted, the intersection of the hash classes from each instance will point to a single malloc type that is being misused. At this point inspection or memguard(9) can be used to catch the offending code. Add MALLOC_DEBUG_MAXZONES=8 to -current GENERIC configuration files. The suggestion to have this on by default came from Kostik Belousov on -arch. This code is based on work by Ron Steinke at Isilon Systems. Reviewed by: -arch (mostly silence) Reviewed by: zml Approved by: zml (mentor) --- sys/powerpc/conf/GENERIC | 1 + 1 file changed, 1 insertion(+) (limited to 'sys/powerpc/conf') diff --git a/sys/powerpc/conf/GENERIC b/sys/powerpc/conf/GENERIC index 1a0ede6..8bcb06a 100644 --- a/sys/powerpc/conf/GENERIC +++ b/sys/powerpc/conf/GENERIC @@ -74,6 +74,7 @@ options INVARIANTS #Enable calls of extra sanity checking options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required by INVARIANTS options WITNESS #Enable checks to detect deadlocks and cycles options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed +options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # To make an SMP kernel, the next line is needed #options SMP # Symmetric MultiProcessor Kernel -- cgit v1.1