diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-01 14:31:26 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-01 14:31:26 +0000 |
commit | 6b217c913eb9e9a8ef7d6c02c53cd41e4a1366c9 (patch) | |
tree | 6a81fe54ea23412608cfc04c0673b8b747db2a68 /sys/uvm/uvm_device.c | |
parent | 568eb928b4dc08503dace2a2c4f0aed3e2ef65c7 (diff) |
Don't allow negative offsets. Some type confusion.
Diffstat (limited to 'sys/uvm/uvm_device.c')
-rw-r--r-- | sys/uvm/uvm_device.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/uvm/uvm_device.c b/sys/uvm/uvm_device.c index 2430fc5ef17..b61ff7d7157 100644 --- a/sys/uvm/uvm_device.c +++ b/sys/uvm/uvm_device.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_device.c,v 1.13 2001/11/01 12:13:47 art Exp $ */ +/* $OpenBSD: uvm_device.c,v 1.14 2001/11/01 14:31:25 art Exp $ */ /* $NetBSD: uvm_device.c,v 1.22 2000/05/28 10:21:55 drochner Exp $ */ /* @@ -149,6 +149,9 @@ udv_attach(arg, accessprot, off, size) mapfn == (paddr_t (*) __P((dev_t, off_t, int)))nullop) return(NULL); + if (off < 0) + return (NULL); + /* * Check that the specified range of the device allows the * desired protection. @@ -408,8 +411,8 @@ udv_fault(ufi, vaddr, pps, npages, centeridx, fault_type, access_type, flags) struct uvm_device *udv = (struct uvm_device *)uobj; vaddr_t curr_va; int curr_offset; - paddr_t paddr; - int lcv, retval, mdpgno; + paddr_t paddr, mdpgno; + int lcv, retval; dev_t device; paddr_t (*mapfn) __P((dev_t, off_t, int)); vm_prot_t mapprot; |