Changeset View
Changeset View
Standalone View
Standalone View
sys/vm/vm_mmap.c
Context not available. | |||||
#include "opt_compat.h" | #include "opt_compat.h" | ||||
#include "opt_hwpmc_hooks.h" | #include "opt_hwpmc_hooks.h" | ||||
#include "opt_pax.h" | |||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
Context not available. | |||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/sysproto.h> | #include <sys/sysproto.h> | ||||
#include <sys/filedesc.h> | #include <sys/filedesc.h> | ||||
#include <sys/pax.h> | |||||
#include <sys/priv.h> | #include <sys/priv.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/procctl.h> | #include <sys/procctl.h> | ||||
Context not available. | |||||
struct file *fp; | struct file *fp; | ||||
struct vnode *vp; | struct vnode *vp; | ||||
vm_offset_t addr; | vm_offset_t addr; | ||||
#ifdef PAX_ASLR | |||||
vm_offset_t orig_addr; | |||||
#endif | |||||
vm_size_t size, pageoff; | vm_size_t size, pageoff; | ||||
vm_prot_t cap_maxprot, prot, maxprot; | vm_prot_t cap_maxprot, prot, maxprot; | ||||
void *handle; | void *handle; | ||||
Context not available. | |||||
cap_rights_t rights; | cap_rights_t rights; | ||||
addr = (vm_offset_t) uap->addr; | addr = (vm_offset_t) uap->addr; | ||||
#ifdef PAX_ASLR | |||||
orig_addr = addr; | |||||
#endif | |||||
size = uap->len; | size = uap->len; | ||||
prot = uap->prot & VM_PROT_ALL; | prot = uap->prot & VM_PROT_ALL; | ||||
flags = uap->flags; | flags = uap->flags; | ||||
bdrewery: Space missing, addr & 0x0fffffff. | |||||
Context not available. | |||||
map: | map: | ||||
td->td_fpop = fp; | td->td_fpop = fp; | ||||
maxprot &= cap_maxprot; | maxprot &= cap_maxprot; | ||||
#ifdef PAX_ASLR | |||||
pax_aslr_mmap(td->td_proc, &addr, orig_addr, flags); | |||||
#endif | |||||
error = vm_mmap(&vms->vm_map, &addr, size, prot, maxprot, | error = vm_mmap(&vms->vm_map, &addr, size, prot, maxprot, | ||||
flags, handle_type, handle, pos); | flags, handle_type, handle, pos); | ||||
td->td_fpop = NULL; | td->td_fpop = NULL; | ||||
Context not available. | |||||
Not Done Inline ActionsWas there some other past use for 'orig_addr', or should this really just be rewriting 'addr' in place? rwatson: Was there some other past use for 'orig_addr', or should this really just be rewriting 'addr'… | |||||
Not Done Inline Actionsop: No. The orig_addr is needed.
https://github.com/HardenedBSD/hardenedBSD/commit/190c95d44fb263a… |
Space missing, addr & 0x0fffffff.