qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] qemu-io: check the size of the I/O requests
@ 2017-01-31 16:09 Alberto Garcia
  2017-01-31 16:09 ` [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX Alberto Garcia
  2017-01-31 16:09 ` [Qemu-devel] [PATCH 2/2] iov: assert that qiov->size doesn't exceed INT_MAX Alberto Garcia
  0 siblings, 2 replies; 18+ messages in thread
From: Alberto Garcia @ 2017-01-31 16:09 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-block, Kevin Wolf, Max Reitz, Alberto Garcia

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(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-02-03 19:00 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-31 16:09 [Qemu-devel] [PATCH 0/2] qemu-io: check the size of the I/O requests Alberto Garcia
2017-01-31 16:09 ` [Qemu-devel] [PATCH 1/2] qemu-io: don't allow I/O operations larger than INT_MAX Alberto Garcia
2017-01-31 16:31   ` Eric Blake
2017-01-31 16:36     ` Alberto Garcia
2017-01-31 16:41       ` Eric Blake
2017-01-31 18:11         ` Alberto Garcia
2017-01-31 22:33           ` Max Reitz
2017-02-01 21:36   ` Max Reitz
2017-02-01 21:49     ` Alberto Garcia
2017-02-01 22:16   ` Max Reitz
2017-02-02  8:52     ` Alberto Garcia
2017-02-03 19:00       ` Max Reitz
2017-01-31 16:09 ` [Qemu-devel] [PATCH 2/2] iov: assert that qiov->size doesn't exceed INT_MAX Alberto Garcia
2017-01-31 16:45   ` Eric Blake
2017-02-01 21:51   ` Max Reitz
2017-02-01 21:55     ` Alberto Garcia
2017-02-01 21:56       ` Max Reitz
2017-02-01 22:00         ` Alberto Garcia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).