diff options
| author | cube <cube@NetBSD.org> | 2007-06-26 15:22:23 +0000 |
|---|---|---|
| committer | cube <cube@NetBSD.org> | 2007-06-26 15:22:23 +0000 |
| commit | 954bc13440fc4d1e330d9305b8e259931d9d62e6 (patch) | |
| tree | 74bc333c564ca5a0dfcab0241fab36b79f319723 /sys/dev/raidframe | |
| parent | f27c6276870ce22b4cbeb06fb0518437c323858f (diff) | |
Change dk_lookup() to accept an additional argument of the type enum uio_seg
that tells whether the given path is in user space or kernel space, so it
can tell NDINIT().
While the raidframe calls were ok, both ccd(4) and cgd(4) were passing
pointers to user space data, which leads to strange error on i386, as
reported by Jukka Salmi on current-users.
The issue has been there since last august, I'm actually a bit surprised
that no one in the meantime has used ccd(4) or cgd(4) on an arch where it
would have simply faulted.
Diffstat (limited to 'sys/dev/raidframe')
| -rw-r--r-- | sys/dev/raidframe/rf_copyback.c | 7 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_disks.c | 6 | ||||
| -rw-r--r-- | sys/dev/raidframe/rf_reconstruct.c | 6 |
3 files changed, 10 insertions, 9 deletions
diff --git a/sys/dev/raidframe/rf_copyback.c b/sys/dev/raidframe/rf_copyback.c index f4059d2a4e6..248214bd69d 100644 --- a/sys/dev/raidframe/rf_copyback.c +++ b/sys/dev/raidframe/rf_copyback.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_copyback.c,v 1.37 2006/11/16 01:33:23 christos Exp $ */ +/* $NetBSD: rf_copyback.c,v 1.38 2007/06/26 15:22:24 cube Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -38,7 +38,7 @@ ****************************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.37 2006/11/16 01:33:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_copyback.c,v 1.38 2007/06/26 15:22:24 cube Exp $"); #include <dev/raidframe/raidframevar.h> @@ -136,7 +136,8 @@ rf_CopybackReconstructedData(RF_Raid_t *raidPtr) printf("About to (re-)open the device: %s\n", raidPtr->Disks[fcol].devname); - retcode = dk_lookup(raidPtr->Disks[fcol].devname, l, &vp); + retcode = dk_lookup(raidPtr->Disks[fcol].devname, l, &vp, + UIO_SYSSPACE); if (retcode) { printf("raid%d: copyback: dk_lookup on device: %s failed: %d!\n", diff --git a/sys/dev/raidframe/rf_disks.c b/sys/dev/raidframe/rf_disks.c index c162150feb6..f0915283d34 100644 --- a/sys/dev/raidframe/rf_disks.c +++ b/sys/dev/raidframe/rf_disks.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_disks.c,v 1.65 2007/03/13 16:31:24 christos Exp $ */ +/* $NetBSD: rf_disks.c,v 1.66 2007/06/26 15:22:24 cube Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. * All rights reserved. @@ -67,7 +67,7 @@ ***************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.65 2007/03/13 16:31:24 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_disks.c,v 1.66 2007/06/26 15:22:24 cube Exp $"); #include <dev/raidframe/raidframevar.h> @@ -602,7 +602,7 @@ rf_ConfigureDisk(RF_Raid_t *raidPtr, char *bf, RF_RaidDisk_t *diskPtr, return (0); } - error = dk_lookup(diskPtr->devname, l, &vp); + error = dk_lookup(diskPtr->devname, l, &vp, UIO_SYSSPACE); if (error) { printf("dk_lookup on device: %s failed!\n", diskPtr->devname); if (error == ENXIO) { diff --git a/sys/dev/raidframe/rf_reconstruct.c b/sys/dev/raidframe/rf_reconstruct.c index 0d5ad1084f9..af7fa06767c 100644 --- a/sys/dev/raidframe/rf_reconstruct.c +++ b/sys/dev/raidframe/rf_reconstruct.c @@ -1,4 +1,4 @@ -/* $NetBSD: rf_reconstruct.c,v 1.95 2006/11/16 01:33:23 christos Exp $ */ +/* $NetBSD: rf_reconstruct.c,v 1.96 2007/06/26 15:22:24 cube Exp $ */ /* * Copyright (c) 1995 Carnegie-Mellon University. * All rights reserved. @@ -33,7 +33,7 @@ ************************************************************/ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.95 2006/11/16 01:33:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rf_reconstruct.c,v 1.96 2007/06/26 15:22:24 cube Exp $"); #include <sys/time.h> #include <sys/buf.h> @@ -438,7 +438,7 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr, RF_RowCol_t col) raidPtr->Disks[col].devname); #endif RF_UNLOCK_MUTEX(raidPtr->mutex); - retcode = dk_lookup(raidPtr->Disks[col].devname, lwp, &vp); + retcode = dk_lookup(raidPtr->Disks[col].devname, lwp, &vp, UIO_SYSSPACE); if (retcode) { printf("raid%d: rebuilding: dk_lookup on device: %s failed: %d!\n",raidPtr->raidid, |
