diff options
| author | Alexander Motin <mav@FreeBSD.org> | 2009-07-16 19:48:39 +0000 |
|---|---|---|
| committer | Alexander Motin <mav@FreeBSD.org> | 2009-07-16 19:48:39 +0000 |
| commit | d96aeec8ff233479463f2ffea3fe425da52840ed (patch) | |
| tree | 4f85b933808bed917d808d318cbba7cb1efa76a4 | |
| parent | e57e15a182d5a0d0a9095cb32539c99335a4d683 (diff) | |
Notes
| -rw-r--r-- | sys/dev/ata/ata-all.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-all.c b/sys/dev/ata/ata-all.c index 4530767f3aaa..383060cf0ad6 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -472,6 +472,7 @@ int ata_device_ioctl(device_t dev, u_long cmd, caddr_t data) { struct ata_device *atadev = device_get_softc(dev); + struct ata_channel *ch = device_get_softc(device_get_parent(dev)); struct ata_ioc_request *ioc_request = (struct ata_ioc_request *)data; struct ata_params *params = (struct ata_params *)data; int *mode = (int *)data; @@ -481,6 +482,10 @@ ata_device_ioctl(device_t dev, u_long cmd, caddr_t data) switch (cmd) { case IOCATAREQUEST: + if (ioc_request->count > + (ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS)) { + return (EFBIG); + } if (!(buf = malloc(ioc_request->count, M_ATA, M_NOWAIT))) { return ENOMEM; } |
