]> git.ipfire.org Git - thirdparty/qemu.git/commit
scsi: esp: make cmdbuf big enough for maximum CDB size
authorPrasad J Pandit <pjp@fedoraproject.org>
Wed, 15 Jun 2016 22:22:35 +0000 (00:22 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 9 Aug 2016 19:31:04 +0000 (14:31 -0500)
commit27fa5e735a267d21b3ae040b059636d5063bb7e4
treec537bb16003e5b028366065aca48d27ada0f86fc
parent8c04a291c91e072c01a9724b04b170d0026ca065
scsi: esp: make cmdbuf big enough for maximum CDB size

While doing DMA read into ESP command buffer 's->cmdbuf', it could
write past the 's->cmdbuf' area, if it was transferring more than 16
bytes.  Increase the command buffer size to 32, which is maximum when
's->do_cmd' is set, and add a check on 'len' to avoid OOB access.

Reported-by: Li Qiang <liqiang6-s@360.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 926cde5f3e4d2504ed161ed0cb771ac7cad6fd11)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/scsi/esp.c
include/hw/scsi/esp.h