From owner-freebsd-bugs Fri Jan 7 4:27:24 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freebsd.dk (freebsd.dk [212.242.42.178]) by hub.freebsd.org (Postfix) with ESMTP id 5A9021565C for ; Fri, 7 Jan 2000 04:27:19 -0800 (PST) (envelope-from sos@freebsd.dk) Received: (from sos@localhost) by freebsd.dk (8.9.3/8.9.1) id NAA83738; Fri, 7 Jan 2000 13:17:51 +0100 (CET) (envelope-from sos) From: Soren Schmidt Message-Id: <200001071217.NAA83738@freebsd.dk> Subject: Re: kern/15956: Off-by-1 error in diskstrategy() triggers bug in ATA In-Reply-To: <200001071210.EAA13523@freefall.freebsd.org> from Poul-Henning Kamp at "Jan 7, 2000 04:10:02 am" To: phk@critter.freebsd.dk (Poul-Henning Kamp) Date: Fri, 7 Jan 2000 13:17:51 +0100 (CET) Cc: freebsd-bugs@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org It seems Poul-Henning Kamp wrote: > >Index: subr_disk.c > >=================================================================== > >RCS file: /home/CVSROOT/src/sys/kern/subr_disk.c,v > >retrieving revision 1.16 > >diff -u -r1.16 subr_disk.c > >--- subr_disk.c 1999/12/19 12:36:41 1.16 > >+++ subr_disk.c 2000/01/06 21:39:34 > >@@ -193,7 +193,7 @@ > > return; > > } > > > >- if (dscheck(bp, dp->d_slice) < 0) { > >+ if (dscheck(bp, dp->d_slice) <= 0) { > > biodone(bp); > > return; > > } > > > > 2) Add belt-and-braces checks to ATA device (this code compiles > > and links, but I haven't booted from the resultant kernel): > > This was actually done that way deliberately, but not for any > specific reason. > > Input welcome... I've put this in the ata drivers: /* if it's a null transfer, return immediatly. */ if (bp->b_bcount == 0) { bp->b_resid = 0; biodone(bp); return; } -Søren To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message