mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-29 12:44:53 +01:00
I have some problem here, which shows up in the ahc0 driver. It isn't where
it originates, so I catch it here and fail. This may expose the same bug on other disk controllers (both scsi & ide).
This commit is contained in:
parent
e61201fedd
commit
d63b42b7f8
@ -31,7 +31,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94
|
* @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94
|
||||||
* $Id: spec_vnops.c,v 1.25 1995/12/13 15:13:31 julian Exp $
|
* $Id: spec_vnops.c,v 1.26 1995/12/14 09:53:06 phk Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -756,6 +756,12 @@ spec_getpages(ap)
|
|||||||
*/
|
*/
|
||||||
blkno = (IDX_TO_OFF(ap->a_m[0]->pindex) + ap->a_offset) / DEV_BSIZE;
|
blkno = (IDX_TO_OFF(ap->a_m[0]->pindex) + ap->a_offset) / DEV_BSIZE;
|
||||||
|
|
||||||
|
/* XXX sanity check before we go into details */
|
||||||
|
if (blkno < 0) {
|
||||||
|
printf("spec_getpages: negative blkno (%ld)\n", blkno);
|
||||||
|
return (VM_PAGER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Round up physical size for real devices.
|
* Round up physical size for real devices.
|
||||||
*/
|
*/
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94
|
* @(#)spec_vnops.c 8.6 (Berkeley) 4/9/94
|
||||||
* $Id: spec_vnops.c,v 1.25 1995/12/13 15:13:31 julian Exp $
|
* $Id: spec_vnops.c,v 1.26 1995/12/14 09:53:06 phk Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -756,6 +756,12 @@ spec_getpages(ap)
|
|||||||
*/
|
*/
|
||||||
blkno = (IDX_TO_OFF(ap->a_m[0]->pindex) + ap->a_offset) / DEV_BSIZE;
|
blkno = (IDX_TO_OFF(ap->a_m[0]->pindex) + ap->a_offset) / DEV_BSIZE;
|
||||||
|
|
||||||
|
/* XXX sanity check before we go into details */
|
||||||
|
if (blkno < 0) {
|
||||||
|
printf("spec_getpages: negative blkno (%ld)\n", blkno);
|
||||||
|
return (VM_PAGER_ERROR);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Round up physical size for real devices.
|
* Round up physical size for real devices.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user