This set of patches fixes four reported bugs in vmdk's handling of
potentially malicious image files:
#3843: if cluster_sectors is 0x200000 we can overflow an 'int' and try
to g_malloc() 0xffffffff80000000
#4017: if cluster_sectors is 0 we will divide by zero and SIGFPE
#4029: we can overflow a 32*64 multiply; we catch it a bit later on
so there are no ill-effects, but for robustness it's better to
check before the multiply
#4571: we can read off the end of a block of memory when trying to
parse descriptors; worst case is that we read some junk from
the heap into BlockDriverState::auto_backing_file and
::backing_file. I don't think this is an exploitable info
leak into the guest.
#4571: if the input file specifies no extents, we hit an assert
in vmdk_co_get_info() rather than rejecting the file
(mentioned in passing in the same issue as previous bug)
I think these all classify as "hardening bugs" rather than security
issues, since they're just "self-denial-of-service" at worst.
Tested using qemu-iotests on the vmdk format.
thanks
-- PMM
Peter Maydell (5):
block/vmdk: Avoid assertion if image file has no extents
block/vmdk: Avoid reading off the end of descriptor memory
block/vmdk: Use larger types for byte counts in vmdk_read_extent()
block/vmdk: Reject a zero cluster_sectors parameter
block/vmdk: Avoid overflowing multiplication in vmdk_open_vmdk4()
block/vmdk.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
--
2.43.0