freebsd-dev/sys/vm
Bosko Milekic e4eb384b47 Bring in MemGuard, a very simple and small replacement allocator
designed to help detect tamper-after-free scenarios, a problem more
and more common and likely with multithreaded kernels where race
conditions are more prevalent.

Currently MemGuard can only take over malloc()/realloc()/free() for
particular (a) malloc type(s) and the code brought in with this
change manually instruments it to take over M_SUBPROC allocations
as an example.  If you are planning to use it, for now you must:

	1) Put "options DEBUG_MEMGUARD" in your kernel config.
	2) Edit src/sys/kern/kern_malloc.c manually, look for
	   "XXX CHANGEME" and replace the M_SUBPROC comparison with
	   the appropriate malloc type (this might require additional
	   but small/simple code modification if, say, the malloc type
	   is declared out of scope).
	3) Build and install your kernel.  Tune vm.memguard_divisor
	   boot-time tunable which is used to scale how much of kmem_map
	   you want to allott for MemGuard's use.  The default is 10,
	   so kmem_size/10.

ToDo:
	1) Bring in a memguard(9) man page.
	2) Better instrumentation (e.g., boot-time) of MemGuard taking
	   over malloc types.
	3) Teach UMA about MemGuard to allow MemGuard to override zone
	   allocations too.
	4) Improve MemGuard if necessary.

This work is partly based on some old patches from Ian Dowse.
2005-01-21 18:09:17 +00:00
..
default_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
device_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
memguard.c Bring in MemGuard, a very simple and small replacement allocator 2005-01-21 18:09:17 +00:00
memguard.h Bring in MemGuard, a very simple and small replacement allocator 2005-01-21 18:09:17 +00:00
phys_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
pmap.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
swap_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
swap_pager.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
uma_core.c While we want the recursion protection for the bucket zones so that 2005-01-11 03:33:09 +00:00
uma_dbg.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
uma_dbg.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
uma_int.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
uma.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_contig.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_extern.h Disable U area swapping and remove the routines that create, destroy, 2004-11-20 02:29:00 +00:00
vm_fault.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_glue.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_init.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_kern.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_kern.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_map.c Add checks to vm_map_findspace() to test for address wrap. The conditions 2005-01-18 19:50:09 +00:00
vm_map.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_meter.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_mmap.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_object.c Consider three objects, O, BO, and BBO, where BO is O's backing object 2005-01-15 21:12:47 +00:00
vm_object.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_page.c Transfer responsibility for freeing the page taken from the cache 2005-01-07 05:02:19 +00:00
vm_page.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_pageout.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_pageout.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_pageq.c Remove references to L1 in the comments, according to Alan they are 2004-06-07 19:33:05 +00:00
vm_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_pager.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_param.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_unix.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vm_zeroidle.c Remove dangling variable 2004-11-06 11:33:11 +00:00
vm.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vnode_pager.c /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00
vnode_pager.h /* -> /*- for license, minor formatting changes 2005-01-07 02:29:27 +00:00