summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-08-25 19:47:57 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-08-25 19:47:57 +0000
commit3918f7593b9c68116dbdd13da3af5aa71536f945 (patch)
treeaf80a475272df4d5b959dd97afc9c24dfbdf07be /sys/uvm
parentf47efdb34885a1181ca51b7d8dc04842d5750af5 (diff)
In sys_kbind(), pages from uvm_map_extract() must be written to with kcopy()
ok kettenis@
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm_mmap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/uvm/uvm_mmap.c b/sys/uvm/uvm_mmap.c
index 2b7f0c2c463..e0860d19275 100644
--- a/sys/uvm/uvm_mmap.c
+++ b/sys/uvm/uvm_mmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_mmap.c,v 1.112 2015/07/20 22:41:41 miod Exp $ */
+/* $OpenBSD: uvm_mmap.c,v 1.113 2015/08/25 19:47:56 guenther Exp $ */
/* $NetBSD: uvm_mmap.c,v 1.49 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -1236,7 +1236,9 @@ sys_kbind(struct proc *p, void *v, register_t *retval)
}
/* do the update */
- memcpy((char *)kva + pageoffset, data, paramp[i].kb_size);
+ if ((error = kcopy(data, (char *)kva + pageoffset,
+ paramp[i].kb_size)))
+ break;
data += paramp[i].kb_size;
}