From owner-freebsd-current@FreeBSD.ORG Tue Jun 22 04:35:01 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8189416A4F0 for ; Tue, 22 Jun 2004 04:35:01 +0000 (GMT) Received: from tx1.oucs.ox.ac.uk (tx1.oucs.ox.ac.uk [129.67.1.167]) by mx1.FreeBSD.org (Postfix) with ESMTP id AD61B43D41 for ; Tue, 22 Jun 2004 04:35:00 +0000 (GMT) (envelope-from colin.percival@wadham.ox.ac.uk) Received: from scan1.oucs.ox.ac.uk ([129.67.1.166] helo=localhost) by tx1.oucs.ox.ac.uk with esmtp (Exim 4.24) id 1Bcczr-0001g1-Iq for current@freebsd.org; Tue, 22 Jun 2004 05:34:59 +0100 Received: from rx1.oucs.ox.ac.uk ([129.67.1.165]) by localhost (scan1.oucs.ox.ac.uk [129.67.1.166]) (amavisd-new, port 25) with ESMTP id 04636-07 for ; Tue, 22 Jun 2004 05:34:59 +0100 (BST) Received: from gateway.wadham.ox.ac.uk ([163.1.161.253]) by rx1.oucs.ox.ac.uk with smtp (Exim 4.24) id 1Bccyz-0001Fa-53 for current@freebsd.org; Tue, 22 Jun 2004 05:34:05 +0100 Received: (qmail 5824 invoked by uid 1004); 22 Jun 2004 04:34:05 -0000 Received: from colin.percival@wadham.ox.ac.uk by gateway by uid 71 with qmail-scanner-1.20 (clamscan: 0.67. sweep: 2.18/3.79. Clear:RC:1(163.1.161.131):. Processed in 0.072747 secs); 22 Jun 2004 04:34:05 -0000 Received: from dhcp1131.wadham.ox.ac.uk (HELO piii600.wadham.ox.ac.uk) (163.1.161.131) by gateway.wadham.ox.ac.uk with SMTP; 22 Jun 2004 04:34:05 -0000 Message-Id: <6.1.0.6.1.20040622051016.03cae4e8@popserver.sfu.ca> X-Sender: cperciva@popserver.sfu.ca (Unverified) X-Mailer: QUALCOMM Windows Eudora Version 6.1.0.6 Date: Tue, 22 Jun 2004 05:34:02 +0100 To: chancedj@yahoo.com, le@freebsd.org, phk@freebsd.org, grog@freebsd.org From: Colin Percival In-Reply-To: <20040622035316.30729.qmail@web53702.mail.yahoo.com> References: <20040622035316.30729.qmail@web53702.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" cc: current@freebsd.org Subject: Re: vinum crashing with latest current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2004 04:35:01 -0000 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