diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2004-07-22 00:48:42 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2004-07-22 00:48:42 +0000 |
commit | c93686e4f60cff949f0e9b42fa716e5e5c8fd604 (patch) | |
tree | cf4c0e1d44ee7d44214b2275ad01371b5bc1633a /sys | |
parent | ba247415879d546ce8325bf256936a2c562e53b6 (diff) |
Fix access to direct mapped memory through /dev/kmem.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/mem.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/mem.c b/sys/arch/amd64/amd64/mem.c index 8f648733043..cdd885a832d 100644 --- a/sys/arch/amd64/amd64/mem.c +++ b/sys/arch/amd64/amd64/mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mem.c,v 1.2 2004/02/24 00:20:45 mickey Exp $ */ +/* $OpenBSD: mem.c,v 1.3 2004/07/22 00:48:41 art Exp $ */ /* * Copyright (c) 1988 University of Utah. * Copyright (c) 1982, 1986, 1990, 1993 @@ -172,8 +172,9 @@ mmrw(dev_t dev, struct uio *uio, int flags) if (v < (vaddr_t)&etext && uio->uio_rw == UIO_WRITE) return EFAULT; - } else if (!uvm_kernacc((caddr_t)v, c, - uio->uio_rw == UIO_READ ? B_READ : B_WRITE)) + } else if ((!uvm_kernacc((caddr_t)v, c, + uio->uio_rw == UIO_READ ? B_READ : B_WRITE)) && + (v < PMAP_DIRECT_BASE && v > PMAP_DIRECT_END)) return (EFAULT); error = uiomove((caddr_t)v, c, uio); continue; |