aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_unix.c
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2011-10-13 16:20:10 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2011-10-13 16:20:10 +0000
commit5f81660285be720d5396988e5e5a97a826c812f9 (patch)
treee80d41438146a9af33daafe84708ccae7740c784 /sys/vm/vm_unix.c
parent676eda08d080f02d984a2cc1b0051e4c1c6c593c (diff)
In sys_obreak() and when compiling for amd64 or ia64, when the process
is ILP32 (i.e. i386) grant execute permissions by default. The JDK 1.4.x depends on being able to execute from the heap on i386.
Notes
Notes: svn path=/head/; revision=226343
Diffstat (limited to 'sys/vm/vm_unix.c')
-rw-r--r--sys/vm/vm_unix.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/vm/vm_unix.c b/sys/vm/vm_unix.c
index e08aa6a61dbd..d4ea3b736da0 100644
--- a/sys/vm/vm_unix.c
+++ b/sys/vm/vm_unix.c
@@ -36,6 +36,8 @@
* @(#)vm_unix.c 8.1 (Berkeley) 6/11/93
*/
+#include "opt_compat.h"
+
/*
* Traditional sbrk/grow interface to VM
*/
@@ -49,6 +51,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/racct.h>
#include <sys/resourcevar.h>
+#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <sys/systm.h>
@@ -75,7 +78,7 @@ sys_obreak(td, uap)
struct vmspace *vm = td->td_proc->p_vmspace;
vm_offset_t new, old, base;
rlim_t datalim, vmemlim;
- int rv;
+ int prot, rv;
int error = 0;
boolean_t do_map_wirefuture;
@@ -135,8 +138,15 @@ sys_obreak(td, uap)
}
PROC_UNLOCK(td->td_proc);
#endif
+ prot = VM_PROT_RW;
+#ifdef COMPAT_FREEBSD32
+#if defined(__amd64__) || defined(__ia64__)
+ if (SV_PROC_FLAG(td->td_proc, SV_ILP32))
+ prot |= VM_PROT_EXECUTE;
+#endif
+#endif
rv = vm_map_insert(&vm->vm_map, NULL, 0, old, new,
- VM_PROT_RW, VM_PROT_ALL, 0);
+ prot, VM_PROT_ALL, 0);
if (rv != KERN_SUCCESS) {
#ifdef RACCT
PROC_LOCK(td->td_proc);