summary refs log tree commit diff stats
path: root/hw/arm/omap2.c
diff options
context:
space:
mode:
authorPrasad J Pandit <pjp@fedoraproject.org>2016-09-06 02:20:43 +0530
committerPaolo Bonzini <pbonzini@redhat.com>2016-09-13 19:08:47 +0200
commit49adc5d3f8c6bb75e55ebfeab109c5c37dea65e8 (patch)
treed9f34b84688b61354f92fa5239598456ac5a98a8 /hw/arm/omap2.c
parenta2feb3483e11a389bc93a5bbd40815d6cfdfb07f (diff)
downloadfocaccia-qemu-49adc5d3f8c6bb75e55ebfeab109c5c37dea65e8.tar.gz
focaccia-qemu-49adc5d3f8c6bb75e55ebfeab109c5c37dea65e8.zip
scsi: pvscsi: limit loop to fetch SG list
In PVSCSI paravirtual SCSI bus, pvscsi_convert_sglist can take a very
long time or go into an infinite loop due to two different bugs:

1) the request descriptor data length is defined to be 64 bit. While
building SG list from a request descriptor, it gets truncated to 32bit
in routine 'pvscsi_convert_sglist'. This could lead to an infinite loop
situation large 'dataLen' values when data_length is cast to uint32_t and
chunk_size becomes always zero.  Fix this by removing the incorrect cast.

2) pvscsi_get_next_sg_elem can be called arbitrarily many times if the
element has a zero length.  Get out of the loop early when this happens,
by introducing an upper limit on the number of SG list elements.

Reported-by: Li Qiang <liqiang6-s@360.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <1473108643-12983-1-git-send-email-ppandit@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/arm/omap2.c')
0 files changed, 0 insertions, 0 deletions