VirtualBox

Changeset 35595 in vbox for trunk/src


Ignore:
Timestamp:
Jan 17, 2011 8:05:15 PM (14 years ago)
Author:
vboxsync
Message:

Storage/DevATA+ATAController: only allow read/write commands for ATA devices

Location:
trunk/src/VBox/Devices/Storage
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/ATAController.cpp

    r35560 r35595  
    29222922        case ATA_READ_SECTORS:
    29232923        case ATA_READ_SECTORS_WITHOUT_RETRIES:
    2924             if (!s->pDrvBlock)
     2924            if (!s->pDrvBlock || s->fATAPI)
    29252925                goto abort_cmd;
    29262926            s->cSectorsPerIRQ = 1;
     
    29312931        case ATA_WRITE_SECTORS:
    29322932        case ATA_WRITE_SECTORS_WITHOUT_RETRIES:
     2933            if (!s->pDrvBlock || s->fATAPI)
     2934                goto abort_cmd;
    29332935            s->cSectorsPerIRQ = 1;
    29342936            ataStartTransfer(s, ataGetNSectors(s) * 512, PDMBLOCKTXDIR_TO_DEVICE, ATAFN_BT_READ_WRITE_SECTORS, ATAFN_SS_WRITE_SECTORS, false);
     
    29372939            s->fLBA48 = true;
    29382940        case ATA_READ_MULTIPLE:
    2939             if (!s->cMultSectors)
     2941            if (!s->pDrvBlock || !s->cMultSectors || s->fATAPI)
    29402942                goto abort_cmd;
    29412943            s->cSectorsPerIRQ = s->cMultSectors;
     
    29452947            s->fLBA48 = true;
    29462948        case ATA_WRITE_MULTIPLE:
    2947             if (!s->cMultSectors)
     2949            if (!s->pDrvBlock || !s->cMultSectors || s->fATAPI)
    29482950                goto abort_cmd;
    29492951            s->cSectorsPerIRQ = s->cMultSectors;
     
    29542956        case ATA_READ_DMA:
    29552957        case ATA_READ_DMA_WITHOUT_RETRIES:
    2956             if (!s->pDrvBlock)
     2958            if (!s->pDrvBlock || s->fATAPI)
    29572959                goto abort_cmd;
    29582960            s->cSectorsPerIRQ = ATA_MAX_MULT_SECTORS;
     
    29642966        case ATA_WRITE_DMA:
    29652967        case ATA_WRITE_DMA_WITHOUT_RETRIES:
    2966             if (!s->pDrvBlock)
     2968            if (!s->pDrvBlock || s->fATAPI)
    29672969                goto abort_cmd;
    29682970            s->cSectorsPerIRQ = ATA_MAX_MULT_SECTORS;
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r35560 r35595  
    36543654        case ATA_READ_SECTORS:
    36553655        case ATA_READ_SECTORS_WITHOUT_RETRIES:
    3656             if (!s->pDrvBlock)
     3656            if (!s->pDrvBlock || s->fATAPI)
    36573657                goto abort_cmd;
    36583658            s->cSectorsPerIRQ = 1;
     
    36633663        case ATA_WRITE_SECTORS:
    36643664        case ATA_WRITE_SECTORS_WITHOUT_RETRIES:
     3665            if (!s->pDrvBlock || s->fATAPI)
     3666                goto abort_cmd;
    36653667            s->cSectorsPerIRQ = 1;
    36663668            ataStartTransfer(s, ataGetNSectors(s) * 512, PDMBLOCKTXDIR_TO_DEVICE, ATAFN_BT_READ_WRITE_SECTORS, ATAFN_SS_WRITE_SECTORS, false);
     
    36693671            s->fLBA48 = true;
    36703672        case ATA_READ_MULTIPLE:
    3671             if (!s->cMultSectors)
     3673            if (!s->pDrvBlock || !s->cMultSectors || s->fATAPI)
    36723674                goto abort_cmd;
    36733675            s->cSectorsPerIRQ = s->cMultSectors;
     
    36773679            s->fLBA48 = true;
    36783680        case ATA_WRITE_MULTIPLE:
    3679             if (!s->cMultSectors)
     3681            if (!s->pDrvBlock || !s->cMultSectors || s->fATAPI)
    36803682                goto abort_cmd;
    36813683            s->cSectorsPerIRQ = s->cMultSectors;
     
    36863688        case ATA_READ_DMA:
    36873689        case ATA_READ_DMA_WITHOUT_RETRIES:
    3688             if (!s->pDrvBlock)
     3690            if (!s->pDrvBlock || s->fATAPI)
    36893691                goto abort_cmd;
    36903692            s->cSectorsPerIRQ = ATA_MAX_MULT_SECTORS;
     
    36963698        case ATA_WRITE_DMA:
    36973699        case ATA_WRITE_DMA_WITHOUT_RETRIES:
    3698             if (!s->pDrvBlock)
     3700            if (!s->pDrvBlock || s->fATAPI)
    36993701                goto abort_cmd;
    37003702            s->cSectorsPerIRQ = ATA_MAX_MULT_SECTORS;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette