summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-09-21 22:07:17 +0000
committerjake <jake@FreeBSD.org>2002-09-21 22:07:17 +0000
commit2b71a04b1e46f7a598269467b77323fad8f53189 (patch)
tree5a29a2272e4b65acf468c2f877289cf21786b297 /sys/compat
parent5ea401e1a679065a9e8506758d9735855dc7a419 (diff)
downloadFreeBSD-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/compat')
-rw-r--r--sys/compat/linprocfs/linprocfs.c3
-rw-r--r--sys/compat/pecoff/imgact_pecoff.c2
-rw-r--r--sys/compat/svr4/imgact_svr4.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c
index 74280d6..d0db293 100644
--- a/sys/compat/linprocfs/linprocfs.c
+++ b/sys/compat/linprocfs/linprocfs.c
@@ -701,7 +701,8 @@ linprocfs_doproccmdline(PFS_FILL_ARGS)
sbuf_printf(sb, "%.*s", MAXCOMLEN, p->p_comm);
} else {
PROC_UNLOCK(p);
- error = copyin((void*)PS_STRINGS, &pstr, sizeof(pstr));
+ error = copyin((void *)p->p_sysent->sv_psstrings, &pstr,
+ sizeof(pstr));
if (error)
return (error);
for (i = 0; i < pstr.ps_nargvstr; i++) {
diff --git a/sys/compat/pecoff/imgact_pecoff.c b/sys/compat/pecoff/imgact_pecoff.c
index 812aa5e..1d70189 100644
--- a/sys/compat/pecoff/imgact_pecoff.c
+++ b/sys/compat/pecoff/imgact_pecoff.c
@@ -486,7 +486,7 @@ exec_pecoff_coff_prep_zmagic(struct image_params * imgp,
peofs + PECOFF_HDR_SIZE, (caddr_t) sh, scnsiz);
if ((error = exec_extract_strings(imgp)) != 0)
goto fail;
- exec_new_vmspace(imgp, VM_MIN_ADDRESS, VM_MAXUSER_ADDRESS, USRSTACK);
+ exec_new_vmspace(imgp, &pecoff_sysvec);
vmspace = imgp->proc->p_vmspace;
for (i = 0; i < fp->f_nscns; i++) {
prot = VM_PROT_WRITE; /* XXX for relocation? */
diff --git a/sys/compat/svr4/imgact_svr4.c b/sys/compat/svr4/imgact_svr4.c
index 3032c54..693793a 100644
--- a/sys/compat/svr4/imgact_svr4.c
+++ b/sys/compat/svr4/imgact_svr4.c
@@ -122,7 +122,7 @@ exec_svr4_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, &svr4_sysvec);
vmspace = imgp->proc->p_vmspace;
/*
OpenPOWER on IntegriCloud