diff options
author | 2015-10-30 16:47:01 +0000 | |
---|---|---|
committer | 2015-10-30 16:47:01 +0000 | |
commit | 14c053e9782bc53462ed0dd2cadd4bffca3ad450 (patch) | |
tree | f99e9efa7d7da3d6ed777af9fac15b9facc5b298 | |
parent | Remove support for sending status reports to syslog on SIGINFO; (diff) | |
download | wireguard-openbsd-14c053e9782bc53462ed0dd2cadd4bffca3ad450.tar.xz wireguard-openbsd-14c053e9782bc53462ed0dd2cadd4bffca3ad450.zip |
Fix two (verified to be harmless) off-by-ones in bounds checks in
uvm_page_init() (causing uvmexp.npages to be sligthly wrong if
pmap_steal_memory() has been used) and uvm_page_physload().
ok guenther@ kettenis@ visa@ beck@
-rw-r--r-- | sys/uvm/uvm_page.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c index 08160054b48..3826a4d7dd5 100644 --- a/sys/uvm/uvm_page.c +++ b/sys/uvm/uvm_page.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_page.c,v 1.143 2015/10/08 15:58:38 kettenis Exp $ */ +/* $OpenBSD: uvm_page.c,v 1.144 2015/10/30 16:47:01 miod Exp $ */ /* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */ /* @@ -249,7 +249,7 @@ uvm_page_init(vaddr_t *kvm_startp, vaddr_t *kvm_endp) curpg->phys_addr = paddr; VM_MDPAGE_INIT(curpg); if (pgno >= seg->avail_start && - pgno <= seg->avail_end) { + pgno < seg->avail_end) { uvmexp.npages++; } } @@ -555,7 +555,7 @@ uvm_page_physload(paddr_t start, paddr_t end, paddr_t avail_start, pgs[lcv].phys_addr = paddr; VM_MDPAGE_INIT(&pgs[lcv]); if (atop(paddr) >= avail_start && - atop(paddr) <= avail_end) { + atop(paddr) < avail_end) { if (flags & PHYSLOAD_DEVICE) { atomic_setbits_int(&pgs[lcv].pg_flags, PG_DEV); |