summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2005-06-01 18:34:40 +0000
committertedu <tedu@openbsd.org>2005-06-01 18:34:40 +0000
commit48fc3ea0052e90e8381d0f35cc9deac53187ae79 (patch)
tree8c3e7ee2748101c2e925661536731fe3f190c6df
parentmissed these in previous commits. (diff)
downloadwireguard-openbsd-48fc3ea0052e90e8381d0f35cc9deac53187ae79.tar.xz
wireguard-openbsd-48fc3ea0052e90e8381d0f35cc9deac53187ae79.zip
use vm_dused for rlimit. much happier with mmap. tested by several
over past week. as a bonus, kills 5 XXXs.
-rw-r--r--sys/uvm/uvm_mmap.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index 73f7ca37f31..eb143f03293 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_mmap.c,v 1.56 2005/05/24 21:11:47 tedu Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.57 2005/06/01 18:34:40 tedu Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -584,17 +584,10 @@ sys_mmap(p, v, retval)
pos = 0;
}
- /*
- * XXX (in)sanity check. We don't do proper datasize checking
- * XXX for anonymous (or private writable) mmap(). However,
- * XXX know that if we're trying to allocate more than the amount
- * XXX remaining under our current data size limit, _that_ should
- * XXX be disallowed.
- */
if ((flags & MAP_ANON) != 0 ||
((flags & MAP_PRIVATE) != 0 && (prot & PROT_WRITE) != 0)) {
if (size >
- (p->p_rlimit[RLIMIT_DATA].rlim_cur - ctob(p->p_vmspace->vm_dsize))) {
+ (p->p_rlimit[RLIMIT_DATA].rlim_cur - ctob(p->p_vmspace->vm_dused))) {
error = ENOMEM;
goto out;
}