qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

vhdx: Check for 4 GB maximum log size on creation

It's unclear what the real maximum is, but we use an uint32_t to store
the log size in vhdx_co_create(), so we should check that the given
value fits in 32 bits.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>

+4
+4
block/vhdx.c
··· 1829 1829 if (!vhdx_opts->has_log_size) { 1830 1830 log_size = DEFAULT_LOG_SIZE; 1831 1831 } else { 1832 + if (vhdx_opts->log_size > UINT32_MAX) { 1833 + error_setg(errp, "Log size must be smaller than 4 GB"); 1834 + return -EINVAL; 1835 + } 1832 1836 log_size = vhdx_opts->log_size; 1833 1837 } 1834 1838 if (log_size < MiB || (log_size % MiB) != 0) {