aboutsummaryrefslogtreecommitdiff
path: root/sys/conf/files
diff options
context:
space:
mode:
authorBosko Milekic <bmilekic@FreeBSD.org>2005-01-21 18:09:17 +0000
committerBosko Milekic <bmilekic@FreeBSD.org>2005-01-21 18:09:17 +0000
commite4eb384b477fe50f3c35034be62d8bf7a04e88c9 (patch)
treee3ac68d91ce5b621ef858776db95b6901b4a7e6b /sys/conf/files
parentdc5ae701946a1c6edf255c5a67ad8537b6be07cc (diff)
downloadsrc-e4eb384b477fe50f3c35034be62d8bf7a04e88c9.tar.gz
src-e4eb384b477fe50f3c35034be62d8bf7a04e88c9.zip
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.
Notes
Notes: svn path=/head/; revision=140587
Diffstat (limited to 'sys/conf/files')
-rw-r--r--sys/conf/files1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/conf/files b/sys/conf/files
index 95c50113a5b3..90a8d489cc2d 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1702,6 +1702,7 @@ vm/swap_pager.c standard
vm/uma_core.c standard
vm/uma_dbg.c standard
vm/vm_contig.c standard
+vm/memguard.c optional DEBUG_MEMGUARD
vm/vm_fault.c standard
vm/vm_glue.c standard
vm/vm_init.c standard