qemu-io: check the size of the I/O requests
Status from this message: Thanks, applied to my block tree, with
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | qemu-io: don't allow I/O operations larger than INT_MAXqemu-io-cmds.c | +12 | 10 replies | |
| 2/2 | iov: assert that qiov->size doesn't exceed INT_MAXutil/ | +6 | 5 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Eric Blake |
|---|---|
| 1/2 | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
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