DragonFly-18.104.22.1689.gc80994 master lib/libc/sys mmap.2 lib/libthread_xu/thread thr_stack.c sys/kern kern_exec.c kern_slaballoc.c vfs_bio.c sys/vm vm_contig.c vm_kern.c vm_map.c vm_map.h vm_mmap.c
dillon at crater.dragonflybsd.org
Thu Apr 23 14:48:03 PDT 2009
Author: Matthew Dillon <dillon at apollo.backplane.com>
Date: Thu Apr 23 14:41:28 2009 -0700
Make adjustments to how MAP_STACK works to prevent improper mmap()s.
Record that a vm_map_entry is a stack mapping. When locating free space
do not allow non-MAP_STACK mappings to use space reserved by MAP_STACK
mappings, unless MAP_FIXED is used of course.
Previously MAP_STACK mappings implied MAP_FIXED, which is not how they are
supposed to work. Implement proper hinting without MAP_FIXED.
Do not allow a normal mmap() call to use space reserved by a MAP_STACK
mapping (unless MAP_FIXED is used of course).
The proper method of making a MAP_STACK mapping inside another MAP_STACK
mapping is to use MAP_STACK | MAP_TRYFIXED. For now, though, we silently
imply MAP_TRYFIXED when MAP_STACK is specified and it will work without it.
Document MAP_TRYFIXED and make it also relax additional requirements imposed
by MAP_STACK mappings inside of MAP_STACK mappings.
Adjust libthread_xu to use MAP_STACK | MAP_TRYFIXED.
Summary of changes:
lib/libc/sys/mmap.2 | 62 ++++++++++++++++++++++-------------
lib/libthread_xu/thread/thr_stack.c | 3 +-
sys/kern/kern_exec.c | 2 +-
sys/kern/kern_slaballoc.c | 2 +-
sys/kern/vfs_bio.c | 2 +-
sys/vm/vm_contig.c | 2 +-
sys/vm/vm_kern.c | 6 ++-
sys/vm/vm_map.c | 62 ++++++++++++++++++++++-------------
sys/vm/vm_map.h | 8 +++--
sys/vm/vm_mmap.c | 34 ++++++++++---------
10 files changed, 111 insertions(+), 72 deletions(-)
DragonFly BSD source repository
More information about the Commits