Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Jan 2000 09:50:01 -0800 (PST)
From:      Matthew Jacob <mjacob@feral.com>
To:        Soren Schmidt <sos@freebsd.dk>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, freebsd-bugs@FreeBSD.ORG
Subject:   Re: kern/15956: Off-by-1 error in diskstrategy() triggers bug in ATA
Message-ID:  <Pine.BSF.4.10.10001070948550.8867-100000@beppo.feral.com>
In-Reply-To: <200001071217.NAA83738@freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help

Uh- this looks like if not a bug in and of itself, covering another bug.


On Fri, 7 Jan 2000, Soren Schmidt wrote:

> It seems Poul-Henning Kamp wrote:
> >  >Index: subr_disk.c
> >  >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> >  >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=091999/12/19 12:36:41=091.16
> >  >+++ subr_disk.c=092000/01/06 21:39:34
> >  >@@ -193,7 +193,7 @@
> >  > =09=09return;
> >  > =09}
> >  >=20
> >  >-=09if (dscheck(bp, dp->d_slice) < 0) {
> >  >+=09if (dscheck(bp, dp->d_slice) <=3D 0) {
> >  > =09=09biodone(bp);
> >  > =09=09return;
> >  > =09}
> >  >
> >  >=092) Add belt-and-braces checks to ATA device (this code compiles
> >  >=09   and links, but I haven't booted from the resultant kernel):
> > =20
> >  This was actually done that way deliberately, but not for any
> >  specific reason.
> > =20
> >  Input welcome...
>=20
> I've put this in the ata drivers:
>=20
>     /* if it's a null transfer, return immediatly. */
>     if (bp->b_bcount =3D=3D 0) {
>         bp->b_resid =3D 0;
>         biodone(bp);
>         return;
>     }
>=20
> -S=F8ren
>=20
>=20
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-bugs" in the body of the message
>=20



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.10001070948550.8867-100000>