summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_unix.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-02-05 07:49:29 +0000
committerdillon <dillon@FreeBSD.org>1999-02-05 07:49:29 +0000
commiteb4dbd2f370b199b5ce49548b872241714c9776c (patch)
treeebc348f3dd67a7b68dc182e2212afaa17064c729 /sys/vm/vm_unix.c
parent0f5cb656a48f893e527851effaf472c12c010f8c (diff)
downloadFreeBSD-src-eb4dbd2f370b199b5ce49548b872241714c9776c.zip
FreeBSD-src-eb4dbd2f370b199b5ce49548b872241714c9776c.tar.gz
The elf loader sets the permissions on bss to VM_PROT_READ|VM_PROT_WRITE
rather then VM_PROT_ALL. obreak, on the otherhand, uses VM_PROT_ALL. This prevents vm_map_insert() from being able to coalesce the heap and creates an extra map entry. Since current architectures ignore VM_PROT_EXECUTE anyway, and since not having VM_PROT_EXECUTE on data/bss may provide protection in the future, obreak now uses read+write rather then all (r+w+x). This is an optimization, not a bug fix. Submitted by: Alan Cox <alc@cs.rice.edu>
Diffstat (limited to 'sys/vm/vm_unix.c')
-rw-r--r--sys/vm/vm_unix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/vm/vm_unix.c b/sys/vm/vm_unix.c
index 21a4a97..d049061 100644
--- a/sys/vm/vm_unix.c
+++ b/sys/vm/vm_unix.c
@@ -38,7 +38,7 @@
* from: Utah $Hdr: vm_unix.c 1.1 89/11/07$
*
* @(#)vm_unix.c 8.1 (Berkeley) 6/11/93
- * $Id: vm_unix.c,v 1.16 1997/11/06 19:29:57 phk Exp $
+ * $Id: vm_unix.c,v 1.17 1998/10/13 08:24:44 dg Exp $
*/
/*
@@ -98,7 +98,7 @@ obreak(p, uap)
}
diff = new - old;
rv = vm_map_find(&vm->vm_map, NULL, 0, &old, diff, FALSE,
- VM_PROT_ALL, VM_PROT_ALL, 0);
+ VM_PROT_READ|VM_PROT_WRITE, VM_PROT_ALL, 0);
if (rv != KERN_SUCCESS) {
return (ENOMEM);
}
OpenPOWER on IntegriCloud