Thomas Higdon e2f0c49ffa 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>
2012-01-26 14:49:18 +01:00
..
2012-01-13 10:55:56 -06:00
2012-01-13 10:55:56 -06:00
2012-01-22 07:27:06 +00:00
2012-01-19 12:14:40 +01:00
2012-01-13 10:55:56 -06:00
2012-01-22 07:27:06 +00:00
2012-01-13 10:55:56 -06:00
2012-01-25 18:32:59 +00:00
2012-01-13 10:55:56 -06:00
2012-01-13 10:55:56 -06:00
2012-01-13 10:55:56 -06:00
2012-01-21 05:17:04 +01:00
2012-01-20 00:27:12 +01:00
2012-01-17 10:54:07 +00:00
2012-01-13 10:20:50 -06:00
2012-01-22 07:27:06 +00:00
2012-01-13 10:55:56 -06:00
2012-01-22 07:27:06 +00:00
2012-01-22 07:27:06 +00:00
2012-01-13 10:55:56 -06:00
2012-01-13 10:20:50 -06:00
2012-01-17 01:40:18 +01:00
2012-01-22 07:27:06 +00:00
2012-01-22 07:27:06 +00:00
2012-01-22 07:27:06 +00:00
2012-01-22 07:29:16 +00:00
2012-01-07 21:29:26 +01:00
2012-01-13 10:55:56 -06:00
2012-01-22 07:27:06 +00:00
2012-01-13 10:55:56 -06:00
2012-01-13 10:55:56 -06:00
2012-01-13 10:55:56 -06:00
2012-01-13 10:55:56 -06:00
2012-01-13 10:25:44 +01:00
2012-01-13 10:25:44 +01:00
2012-01-17 09:44:50 +01:00
2012-01-13 10:25:44 +01:00
2012-01-13 10:25:44 +01:00
2012-01-13 10:25:44 +01:00
2012-01-13 10:25:44 +01:00
2012-01-13 10:25:44 +01:00
2012-01-13 10:25:44 +01:00
2012-01-13 10:25:44 +01:00
2012-01-17 09:44:32 +01:00
2012-01-21 05:17:01 +01:00
2012-01-22 07:27:06 +00:00
2012-01-13 10:55:56 -06:00