vinum crashing with latest current
Colin Percival
colin.percival at wadham.ox.ac.uk
Tue Jun 22 04:35:01 GMT 2004
At 04:53 22/06/2004, Daryl Chance wrote:
>[summary: vinum is breaking, with a null pointer dereference]
In sys/dev/vinum/vinumio.c we find (existing in various forms for
the past four years):
71 drive->lasterror = (dsw->d_open) (drive->dev, FWRITE | FREAD, 0, NULL);
while in src/sys/geom/geom_dev.c we find (added three days ago):
151 g_dev_open(struct cdev *dev, int flags, int fmt, struct thread *td)
...
177 error = securelevel_ge(td->td_ucred, 2);
Now, I'm not sure which of these is correct, but ONE of the following
two patches should be applied:
--- src/sys/dev/vinum/vinumio.c 17 Jun 2004 17:16:47 -0000 1.99
+++ src/sys/dev/vinum/vinumio.c 22 Jun 2004 04:29:08 -0000
@@ -68,7 +68,7 @@ open_drive(struct drive *drive, struct t
drive->lasterror = ENOTBLK;
else {
DROP_GIANT();
- drive->lasterror = (dsw->d_open) (drive->dev, FWRITE | FREAD, 0, NULL);
+ drive->lasterror = (dsw->d_open) (drive->dev, FWRITE | FREAD, 0, td);
PICKUP_GIANT();
}
OR
--- src/sys/geom/geom_dev.c 19 Jun 2004 09:00:53 -0000 1.77
+++ src/sys/geom/geom_dev.c 22 Jun 2004 04:26:01 -0000
@@ -169,7 +169,7 @@ g_dev_open(struct cdev *dev, int flags,
#else
e = 0;
#endif
- if (w) {
+ if (td != NULL && w) {
/*
* When running in very secure mode, do not allow
* opens for writing of any disks.
I'll let the respective maintainers of vinum and geom argue this one
out between them. :-)
Colin Percival
More information about the freebsd-current
mailing list