diff options
author | peter <peter@FreeBSD.org> | 1996-08-02 06:10:49 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-08-02 06:10:49 +0000 |
commit | 29c65f94fc020b904d22c2d62c0fd3441a8a43fd (patch) | |
tree | 453571cf75301f95d4ea073cb1b94fc3c4ec1edc /sys/scsi/od.c | |
parent | 6d6a5bd8e18385ece6b7f53423e560479bc9b796 (diff) | |
download | FreeBSD-src-29c65f94fc020b904d22c2d62c0fd3441a8a43fd.zip FreeBSD-src-29c65f94fc020b904d22c2d62c0fd3441a8a43fd.tar.gz |
The sd and od drivers didn't check for negative block numbers (like wd.c
does) before calling dscheck(). dscheck() doesn't appreciate this and
calls Debugger() and returns without setting bp->b_error.
This can happen when there is a casting error and offsets > 2G are
converted to negative off_t's in the disk tools. (dumpfs used to do this).
Diffstat (limited to 'sys/scsi/od.c')
-rw-r--r-- | sys/scsi/od.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/scsi/od.c b/sys/scsi/od.c index 643357f..c97ec1f 100644 --- a/sys/scsi/od.c +++ b/sys/scsi/od.c @@ -28,7 +28,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $Id: od.c,v 1.18 1996/06/16 19:58:24 joerg Exp $ + * $Id: od.c,v 1.19 1996/07/23 21:52:22 phk Exp $ */ /* @@ -486,9 +486,9 @@ od_strategy(struct buf *bp, struct scsi_link *sc_link) } /* - * Odd number of bytes + * Odd number of bytes or negative offset */ - if (bp->b_bcount % DEV_BSIZE != 0) { + if (bp->b_blkno < 0 || bp->b_bcount % DEV_BSIZE != 0) { bp->b_error = EINVAL; goto bad; } |