| 1973 | } |
| 1974 | |
| 1975 | int |
| 1976 | vm_map_fixed(vm_map_t map, vm_object_t object, vm_ooffset_t offset, |
| 1977 | vm_offset_t start, vm_size_t length, vm_prot_t prot, |
| 1978 | vm_prot_t max, int cow) |
| 1979 | { |
| 1980 | vm_offset_t end; |
| 1981 | int result; |
| 1982 | |
| 1983 | end = start + length; |
| 1984 | KASSERT((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0 || |
| 1985 | object == NULL, |
| 1986 | ("vm_map_fixed: non-NULL backing object for stack")); |
| 1987 | vm_map_lock(map); |
| 1988 | VM_MAP_RANGE_CHECK(map, start, end); |
| 1989 | if ((cow & MAP_CHECK_EXCL) == 0) { |
| 1990 | result = vm_map_delete(map, start, end); |
| 1991 | if (result != KERN_SUCCESS) |
| 1992 | goto out; |
| 1993 | } |
| 1994 | if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) { |
| 1995 | result = vm_map_stack_locked(map, start, length, sgrowsiz, |
| 1996 | prot, max, cow); |
| 1997 | } else { |
| 1998 | result = vm_map_insert(map, object, offset, start, end, |
| 1999 | prot, max, cow); |
| 2000 | } |
| 2001 | out: |
| 2002 | vm_map_unlock(map); |
| 2003 | return (result); |
| 2004 | } |
| 2005 | |
| 2006 | static const int aslr_pages_rnd_64[2] = {0x1000, 0x10}; |
| 2007 | static const int aslr_pages_rnd_32[2] = {0x100, 0x4}; |
no test coverage detected