cloud-hypervisor/qcow/src
Daniel Verkamp 6eeab85db0 qcow: avoid out-of-bounds access in alloc_refblocks
When all refblocks are consumed, the loop looking for the first free
cluster would access the element at refcounts[refcounts.len()], which is
out of bounds.  Modify the free cluster search loop to check that the
index is in bounds before accessing it.

Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Dylan Reid <dgreid@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>

(cherry picked from crosvm commit f21572c7187c8beb9c6bfea6446351ae93200d01)

Fixes: #1792

Signed-off-by: Bo Chen <chen.bo@intel.com>
2020-10-02 09:43:09 +02:00
..
qcow_raw_file.rs qcow, virtio-devices: Break cyclic dependency 2020-07-10 17:47:31 +02:00
qcow.rs qcow: avoid out-of-bounds access in alloc_refblocks 2020-10-02 09:43:09 +02:00
raw_file.rs qcow: raw_file: Fix clippy warning 2020-08-13 16:09:24 +02:00
refcount.rs build: Address issues found by 1.43.0 clippy 2020-05-27 19:32:12 +02:00
vec_cache.rs arch, qcow: Fix 1.42.0 clippy warnings 2020-03-13 12:26:15 +00:00