qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/2] block: Fix error code for bdrv_getlength when the image is too big
@ 2015-05-15  8:36 Fam Zheng
  2015-05-15  8:36 ` [Qemu-devel] [PATCH v2 1/2] block: Detect multiplication overflow in bdrv_getlength Fam Zheng
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Fam Zheng @ 2015-05-15  8:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: Kevin Wolf, berto, armbru, qemu-block

v2: Correct detection of overflow. [Markus, Berto]

If the image has a huge enough virtual size,

  $ qemu-img info afl9.img
  qemu-img: Can't get size of device 'image': Unknown error -512

It's because of the multiplication overflow in the return statement in
bdrv_getlength (the big nagetive value is later truncated to 0x200). Fix it to
return -EFBIG:

  qemu-img: Can't get size of device 'image': File too large

Bug reported by Richard Jones in:

https://bugzilla.redhat.com/show_bug.cgi?id=1221499


Fam Zheng (2):
  block: Detect multiplication overflow in bdrv_getlength
  qemu-iotests: qemu-img info on afl VMDK image with a huge capacity

 block.c                                        |   1 +
 tests/qemu-iotests/059                         |   5 +++++
 tests/qemu-iotests/059.out                     |   3 +++
 tests/qemu-iotests/sample_images/afl9.vmdk.bz2 | Bin 0 -> 178 bytes
 4 files changed, 9 insertions(+)
 create mode 100644 tests/qemu-iotests/sample_images/afl9.vmdk.bz2

-- 
2.4.0

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

end of thread, other threads:[~2015-05-18 14:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-15  8:36 [Qemu-devel] [PATCH v2 0/2] block: Fix error code for bdrv_getlength when the image is too big Fam Zheng
2015-05-15  8:36 ` [Qemu-devel] [PATCH v2 1/2] block: Detect multiplication overflow in bdrv_getlength Fam Zheng
2015-05-15  8:45   ` Alberto Garcia
2015-05-15  8:36 ` [Qemu-devel] [PATCH v2 2/2] qemu-iotests: qemu-img info on afl VMDK image with a huge capacity Fam Zheng
2015-05-15 12:20 ` [Qemu-devel] [PATCH v2 0/2] block: Fix error code for bdrv_getlength when the image is too big Markus Armbruster
2015-05-18 14:51 ` Kevin Wolf

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