summary refs log tree commit diff stats
path: root/hw/core
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2023-09-13 21:44:09 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2023-10-03 10:29:39 +0200
commit77668e4b9bca03a856c27ba899a2513ddf52bb52 (patch)
tree073f68f4b19af7815b219fa7baf6735309a7f4b5 /hw/core
parentb86dc5cb0b4105fa8ad29e822ab5d21c589c5ec5 (diff)
downloadfocaccia-qemu-77668e4b9bca03a856c27ba899a2513ddf52bb52.tar.gz
focaccia-qemu-77668e4b9bca03a856c27ba899a2513ddf52bb52.zip
esp: restrict non-DMA transfer length to that of available data
In the case where a SCSI layer transfer is incorrectly terminated, it is
possible for a TI command to cause a SCSI buffer overflow due to the
expected transfer data length being less than the available data in the
FIFO. When this occurs the unsigned async_len variable underflows and
becomes a large offset which writes past the end of the allocated SCSI
buffer.

Restrict the non-DMA transfer length to be the smallest of the expected
transfer length and the available FIFO data to ensure that it is no longer
possible for the SCSI buffer overflow to occur.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1810
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20230913204410.65650-3-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/core')
0 files changed, 0 insertions, 0 deletions