scsi: esp: check buffer length before reading scsi command
commite5c4e642be623670ecc474316edd777ec4cbc424
authorPrasad J Pandit <pjp@fedoraproject.org>
Tue, 31 May 2016 17:53:27 +0000 (31 23:23 +0530)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 9 Aug 2016 19:30:23 +0000 (9 14:30 -0500)
tree4b111f14d2fb4e99b119ff7e65e7ddf8f7158bd8
parent80eb9b8c4426c6dd145a39f4a44a6fa590de385d
scsi: esp: check buffer length before reading scsi command

The 53C9X Fast SCSI Controller(FSC) comes with an internal 16-byte
FIFO buffer. It is used to handle command and data transfer.
Routine get_cmd() in non-DMA mode, uses 'ti_size' to read scsi
command into a buffer. Add check to validate command length against
buffer size to avoid any overrun.

Reported-by: Li Qiang <liqiang6-s@360.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <1464717207-7549-1-git-send-email-ppandit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit d3cdc49138c30be1d3c2f83d18f85d9fdee95f1a)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/scsi/esp.c