summaryrefslogtreecommitdiffstats
path: root/sys/vm/swap_pager.c
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-05-18 02:59:26 +0000
committerdg <dg@FreeBSD.org>1995-05-18 02:59:26 +0000
commit56d21b42187f0f163a5c67c2126117d7ff8bc6fc (patch)
tree7392d140844fbfda67ab8ff22f1dafd98f01ae78 /sys/vm/swap_pager.c
parent2831e6ec6177d558463cf22f90a0a04d21b4934b (diff)
downloadFreeBSD-src-56d21b42187f0f163a5c67c2126117d7ff8bc6fc.zip
FreeBSD-src-56d21b42187f0f163a5c67c2126117d7ff8bc6fc.tar.gz
Accessing pages beyond the end of a mapped file results in internal
inconsistencies in the VM system that eventually lead to a panic. These changes fix the behavior to conform to the behavior in SunOS, which is to deny faults to pages beyond the EOF (returning SIGBUS). Internally, this is implemented by requiring faults to be within the object size boundaries. These changes exposed another bug, namely that passing in an offset to mmap when trying to map an unnamed anonymous region also results in internal inconsistencies. In this case, the offset is forced to zero. Reviewed by: John Dyson and others
Diffstat (limited to 'sys/vm/swap_pager.c')
-rw-r--r--sys/vm/swap_pager.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index e86e700..e672bb6 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -39,7 +39,7 @@
* from: Utah $Hdr: swap_pager.c 1.4 91/04/30$
*
* @(#)swap_pager.c 8.9 (Berkeley) 3/21/94
- * $Id: swap_pager.c,v 1.38 1995/05/10 18:56:02 davidg Exp $
+ * $Id: swap_pager.c,v 1.39 1995/05/14 03:00:08 davidg Exp $
*/
/*
@@ -273,7 +273,7 @@ swap_pager_alloc(handle, size, prot, offset)
* referenced. Can't do this with handle == NULL since it
* might be the pageout daemon calling.
*/
- object = vm_object_allocate(size);
+ object = vm_object_allocate(offset + size);
object->flags &= ~OBJ_INTERNAL;
vm_object_enter(object, pager);
object->pager = pager;
@@ -1606,7 +1606,7 @@ swap_pager_finish(spc)
}
/*
- * If no error mark as clean and inform the pmap system. If error,
+ * If no error, mark as clean and inform the pmap system. If error,
* mark as dirty so we will try again. (XXX could get stuck doing
* this, should give up after awhile)
*/
OpenPOWER on IntegriCloud