aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Waterman <waterman@cs.berkeley.edu>2015-07-22 16:49:01 -0700
committerAndrew Waterman <waterman@cs.berkeley.edu>2015-07-22 16:55:26 -0700
commit41e85e084acea757cc7e32b6aef47e4563b47717 (patch)
treef8700294c6f298b705540f381adcb002bc0857bd
parenta6da37f21720d12f0295876ce426bc081a62a7d8 (diff)
downloadpk-41e85e084acea757cc7e32b6aef47e4563b47717.zip
pk-41e85e084acea757cc7e32b6aef47e4563b47717.tar.gz
pk-41e85e084acea757cc7e32b6aef47e4563b47717.tar.bz2
Don't let brk stomp on mmap'd regions
We were already trying to handle this case, but we got it wrong.
-rw-r--r--pk/vm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pk/vm.c b/pk/vm.c
index bd69152..bf07c61 100644
--- a/pk/vm.c
+++ b/pk/vm.c
@@ -287,7 +287,7 @@ uintptr_t do_mmap(uintptr_t addr, size_t length, int prot, int flags, int fd, of
addr = __do_mmap(addr, length, prot, flags, f, offset);
if (addr < current.brk_max)
- current.brk_max = ROUNDUP(addr + length, RISCV_PGSIZE);
+ current.brk_max = addr;
spinlock_unlock(&vm_lock);
if (f) file_decref(f);