summaryrefslogtreecommitdiffstats
path: root/qemu-coroutine-sleep.c
diff options
context:
space:
mode:
authorThomas Higdon2012-01-24 18:19:44 +0100
committerKevin Wolf2012-01-26 14:49:18 +0100
commite2f0c49ffae8d3a00272c3cbc68850cc5aafbffa (patch)
tree767ec521762a5c8b60bdb7b6115e2f1970da14c6 /qemu-coroutine-sleep.c
parentqcow: Use bdrv functions to replace file operation (diff)
downloadqemu-e2f0c49ffae8d3a00272c3cbc68850cc5aafbffa.tar.gz
qemu-e2f0c49ffae8d3a00272c3cbc68850cc5aafbffa.tar.xz
qemu-e2f0c49ffae8d3a00272c3cbc68850cc5aafbffa.zip
scsi: Guard against buflen exceeding req->cmd.xfer in scsi_disk_emulate_command
Limit the return value (corresponding to the length of the buffer to be DMAed back to the intiator) to the value in req->cmd.xfer, which is the amount of data that the initiator expects. Eliminate now-duplicate code that does this guarding in the functions for individual commands. Without this, the SCRIPTS code in the emulated LSI device eventually raises a DMA interrupt for a data overrun when an INQUIRY command whose buflen exceeds req->cmd.xfer is processed. It's the responsibility of the client to provide a request buffer and allocation length that are large enough for the result of the command. Signed-off-by: Thomas Higdon <thigdon@akamai.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-coroutine-sleep.c')
0 files changed, 0 insertions, 0 deletions