summaryrefslogtreecommitdiffstats
path: root/tests/qtest/libqtest.c
diff options
context:
space:
mode:
authorMaxim Levitsky2020-10-06 14:39:04 +0200
committerPaolo Bonzini2020-10-12 17:50:51 +0200
commit8cfe8013baec2a6f66240ffd767fad2699d85144 (patch)
tree2bc9af125683c19bd30ea479dcbb280d650e4bec /tests/qtest/libqtest.c
parentvirtio-scsi: use scsi_device_get (diff)
downloadqemu-8cfe8013baec2a6f66240ffd767fad2699d85144.tar.gz
qemu-8cfe8013baec2a6f66240ffd767fad2699d85144.tar.xz
qemu-8cfe8013baec2a6f66240ffd767fad2699d85144.zip
scsi/scsi_bus: fix races in REPORT LUNS
Currently scsi_target_emulate_report_luns iterates over the child device list twice, and there is no guarantee that this list is the same in both iterations. The reason for iterating twice is that the first iteration calculates how much memory to allocate. However if we use a dynamic array we can avoid iterating twice, and therefore we avoid this race. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1866707 Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20200913160259.32145-10-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20201006123904.610658-14-mlevitsk@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tests/qtest/libqtest.c')
0 files changed, 0 insertions, 0 deletions