summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2012-06-03 13:30:04 +0000
committerkettenis <kettenis@openbsd.org>2012-06-03 13:30:04 +0000
commitee03f861852f73531b20e4e5bbf68f11bb110570 (patch)
treefac7ffbcc45bbbe6bfd2e249aeb6153423438e7a
parentAvoid the unlikely but possible use of an uninitialised variable. (diff)
downloadwireguard-openbsd-ee03f861852f73531b20e4e5bbf68f11bb110570.tar.xz
wireguard-openbsd-ee03f861852f73531b20e4e5bbf68f11bb110570.zip
Make sure uvm_map_extract() entesr mappings at an address that doesn't
introduce any virtual cache aliasing problems. Fixes a regression introduced by vmmap. ok ariane@, jsing@
-rw-r--r--sys/uvm/uvm_map.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index 80b99da28a6..5ac0e9fcbed 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.154 2012/06/01 05:47:10 guenther Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.155 2012/06/03 13:30:04 kettenis Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -3972,7 +3972,8 @@ uvm_map_extract(struct vm_map *srcmap, vaddr_t start, vsize_t len,
vm_map_lock(kernel_map);
if (uvm_map_findspace(kernel_map, &tmp1, &tmp2, &dstaddr, len,
- PAGE_SIZE, 0, VM_PROT_NONE, 0) != 0) {
+ MAX(PAGE_SIZE, PMAP_PREFER_ALIGN()), PMAP_PREFER_OFFSET(start),
+ VM_PROT_NONE, 0) != 0) {
error = ENOMEM;
goto fail2;
}