diff options
| author | Prasad J Pandit | 2016-09-05 22:50:43 +0200 |
|---|---|---|
| committer | Paolo Bonzini | 2016-09-13 19:08:47 +0200 |
| commit | 49adc5d3f8c6bb75e55ebfeab109c5c37dea65e8 (patch) | |
| tree | d9f34b84688b61354f92fa5239598456ac5a98a8 /scripts/switch-timer-api | |
| parent | MAINTAINERS: Add some header files to the PC chipset section (diff) | |
| download | qemu-49adc5d3f8c6bb75e55ebfeab109c5c37dea65e8.tar.gz qemu-49adc5d3f8c6bb75e55ebfeab109c5c37dea65e8.tar.xz 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 'scripts/switch-timer-api')
0 files changed, 0 insertions, 0 deletions
