From 2b71a04b1e46f7a598269467b77323fad8f53189 Mon Sep 17 00:00:00 2001 From: jake Date: Sat, 21 Sep 2002 22:07:17 +0000 Subject: 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. --- sys/kern/imgact_aout.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/kern/imgact_aout.c') 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); -- cgit v1.1