Skip site navigation (1)Skip section navigation (2)

FreeBSD Man Pages

Man Page or Keyword Search:
Man Architecture
Apropos Keyword Search (all sections) Output format
home | help
MEMGUARD(9)	       FreeBSD Kernel Developer's Manual	   MEMGUARD(9)

NAME
     MemGuard -- memory	allocator for debugging	purposes

SYNOPSIS
     options DEBUG_MEMGUARD

DESCRIPTION
     MemGuard is a simple and small replacement	memory allocator designed to
     help detect tamper-after-free scenarios.  These problems are more and
     more common and likely with multithreaded kernels where race conditions
     are more prevalent.

     Currently,	MemGuard can only take over malloc(), realloc()	and free() for
     a particular malloc type.

EXAMPLES
     To	use MemGuard for memory	type compiled into the kernel, one has to add
     the following line	to the /boot/loader.conf:

	   vm.memguard.desc=<memory_type>

     Where memory_type is a short description of memory	type to	monitor.  The
     short description of memory type is the second argument to
     MALLOC_DEFINE(9), so one has to find it in	the kernel source.

     To	use MemGuard for memory	type defined in	a kernel module, one has to
     set vm.memguard.desc sysctl(8) variable before loading the	module:

	   sysctl vm.memguard.desc=<memory_type>

     The vm.memguard.divisor boot-time tunable is used to scale	how much of
     kmem_map one wants	to allocate for	MemGuard.  The default is 10, so
     kmem_size/10 bytes	will be	used.  The kmem_size value can be obtained via
     the vm.kmem_size sysctl(8)	variable.

SEE ALSO
     sysctl(8),	vmstat(8), contigmalloc(9), malloc(9), redzone(9)

HISTORY
     MemGuard first appeared in	FreeBSD	6.0.

AUTHORS
     MemGuard was written by Bosko Milekic <bmilekic@FreeBSD.org>.  This man-
     ual page was written by Christian Brueffer	<brueffer@FreeBSD.org>.

BUGS
     Currently,	it is not possible to override UMA zone(9) allocations.

FreeBSD	10.1		       January 31, 2006			  FreeBSD 10.1

NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | SEE ALSO | HISTORY | AUTHORS | BUGS

Want to link to this manual page? Use this URL:
<http://www.freebsd.org/cgi/man.cgi?query=memguard&sektion=9&manpath=FreeBSD+7.0-RELEASE>

home | help