diff options
| author | Alexander Motin <mav@FreeBSD.org> | 2009-07-30 13:19:12 +0000 |
|---|---|---|
| committer | Alexander Motin <mav@FreeBSD.org> | 2009-07-30 13:19:12 +0000 |
| commit | 4178c4ff77d0c818270e38cb8c5a8b60c7570e24 (patch) | |
| tree | b4c9d6a044e3144cc21493d89fb5a3f6e7f3b0f6 /sys/dev/ata | |
| parent | 214c40eb09faf427af91b24bc023ff69c0be1f7a (diff) | |
Notes
Diffstat (limited to 'sys/dev/ata')
| -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 b94559f7126d..c58e675837ab 100644 --- a/sys/dev/ata/ata-all.c +++ b/sys/dev/ata/ata-all.c @@ -440,6 +440,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; @@ -449,6 +450,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; } |
