Skip to content

qemu-io: check the size of the I/O requests

Alberto Garcia qemu-devel 1 version Applied

Status from this message: Thanks, applied to my block tree, with

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 15 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/2qemu-io: don't allow I/O operations larger than INT_MAXqemu-io-cmds.c+12 -910 replies
2/2iov: assert that qiov->size doesn't exceed INT_MAXutil/iov.c+6 -15 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchEric Blake
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/2] qemu-io: check the size of the I/O requests

Hi,

qemu-io allows arbitrary values (up to SIZE_MAX) for the size of its I/O requests, but QEMU cannot handle anything larger than INT_MAX.

   $ qemu-io -c 'aio_write 0 2G' hd.qcow2
   block/block-backend.c:1035: blk_aio_write_entry:
   Assertion `!rwco->qiov || rwco->qiov->size == acb->bytes' failed.
   $ qemu-io -c 'aio_read 0 1G 1G' hd.qcow2
   block/block-backend.c:1024:
   blk_aio_read_entry: Assertion `rwco->qiov->size == acb->bytes' failed.

This series checks that those values are within range and also adds assertions to qemu_iovec_add() and qemu_iovec_init_external() to detect these cases earlier.

Regards,

Berto

Alberto Garcia (2):
qemu-io: don't allow I/O operations larger than INT_MAX
iov: assert that qiov->size doesn't exceed INT_MAX

 qemu-io-cmds.c | 21 ++++++++++++---------
 util/iov.c     |  7 ++++++-
 2 files changed, 18 insertions(+), 10 deletions(-)
Signature · 1 line
2.11.0