diff options
author | jake <jake@FreeBSD.org> | 2002-09-21 22:07:17 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2002-09-21 22:07:17 +0000 |
commit | 2b71a04b1e46f7a598269467b77323fad8f53189 (patch) | |
tree | 5a29a2272e4b65acf468c2f877289cf21786b297 /sys/kern/imgact_aout.c | |
parent | 5ea401e1a679065a9e8506758d9735855dc7a419 (diff) | |
download | FreeBSD-src-2b71a04b1e46f7a598269467b77323fad8f53189.zip FreeBSD-src-2b71a04b1e46f7a598269467b77323fad8f53189.tar.gz |
Use the fields in the sysentvec and in the vm map header in place of the
constants VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, USRSTACK and PS_STRINGS.
This is mainly so that they can be variable even for the native abi, based
on different machine types. Get stack protections from the sysentvec too.
This makes it trivial to map the stack non-executable for certain abis, on
machines that support it.
Diffstat (limited to 'sys/kern/imgact_aout.c')
-rw-r--r-- | sys/kern/imgact_aout.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 8903988..e96054a 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -140,7 +140,7 @@ exec_aout_imgact(imgp) file_offset = 0; /* Pass PS_STRINGS for BSD/OS binaries only. */ if (N_GETMID(*a_out) == MID_ZERO) - imgp->ps_strings = PS_STRINGS; + imgp->ps_strings = aout_sysvec.sv_psstrings; break; default: /* NetBSD compatibility */ @@ -192,7 +192,7 @@ exec_aout_imgact(imgp) /* * Destroy old process VM and create a new one (with a new stack) */ - exec_new_vmspace(imgp, VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, USRSTACK); + exec_new_vmspace(imgp, &aout_sysvec); /* * The vm space can be changed by exec_new_vmspace @@ -299,8 +299,8 @@ aout_coredump(td, vp, limit) IO_UNIT | IO_DIRECT, cred, NOCRED, (int *) NULL, td); if (error == 0) error = vn_rdwr_inchunks(UIO_WRITE, vp, - (caddr_t)trunc_page(USRSTACK - ctob(vm->vm_ssize)), - round_page(ctob(vm->vm_ssize)), + (caddr_t)trunc_page(p->p_sysent->sv_usrstack - + ctob(vm->vm_ssize)), round_page(ctob(vm->vm_ssize)), (off_t)ctob(uarea_pages + kstack_pages) + ctob(vm->vm_dsize), UIO_USERSPACE, IO_UNIT | IO_DIRECT, cred, NOCRED, (int *) NULL, td); |