f2eea93c6b
Hanna Czenczek <hreitz@redhat.com> noted that the array index in virtio_blk_dma_restart_cb() is not bounds-checked: g_autofree VirtIOBlockReq **vq_rq = g_new0(VirtIOBlockReq *, num_queues); ... while (rq) { VirtIOBlockReq *next = rq->next; uint16_t idx = virtio_get_queue_index(rq->vq); rq->next = vq_rq[idx]; ^^^^^^^^^^ The code is correct because both rq->vq and vq_rq[] depend on num_queues, but this is indirect and not 100% obvious. Add an assertion. Suggested-by: Hanna Czenczek <hreitz@redhat.com> Reviewed-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org> Reviewed-by: Hanna Czenczek <hreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-ID: <20240206190610.107963-4-stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> |
||
---|---|---|
.. | ||
dataplane | ||
block.c | ||
cdrom.c | ||
ecc.c | ||
fdc-internal.h | ||
fdc-isa.c | ||
fdc-sysbus.c | ||
fdc.c | ||
hd-geometry.c | ||
Kconfig | ||
m25p80_sfdp.c | ||
m25p80_sfdp.h | ||
m25p80.c | ||
meson.build | ||
nand.c | ||
onenand.c | ||
pflash_cfi01.c | ||
pflash_cfi02.c | ||
swim.c | ||
tc58128.c | ||
trace-events | ||
trace.h | ||
vhost-user-blk.c | ||
virtio-blk-common.c | ||
virtio-blk.c | ||
xen_blkif.h | ||
xen-block.c |