diff --git a/hw/scsi-disk.c b/hw/scsi-disk.c index 50fc3d6eaa541b176e970d23611ff70ae801c7e7..6b139acda1901442fe9fc0940626d04f5cbcebdb 100644 --- a/hw/scsi-disk.c +++ b/hw/scsi-disk.c @@ -1180,6 +1180,9 @@ static int scsi_disk_emulate_command(SCSIDiskReq *r) if (!nb_sectors) { goto not_ready; } + if ((req->cmd.buf[8] & 1) == 0 && req->cmd.lba) { + goto illegal_request; + } nb_sectors /= s->cluster_size; /* Returned value is the address of the last sector. */ nb_sectors--; @@ -1232,6 +1235,9 @@ static int scsi_disk_emulate_command(SCSIDiskReq *r) if (!nb_sectors) { goto not_ready; } + if ((req->cmd.buf[14] & 1) == 0 && req->cmd.lba) { + goto illegal_request; + } nb_sectors /= s->cluster_size; /* Returned value is the address of the last sector. */ nb_sectors--;