[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V2] qemu-img: avoid overflow of min_sparse param

From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH V2] qemu-img: avoid overflow of min_sparse parameter
Date: Fri, 13 Jul 2018 11:14:39 +0200
User-agent: Mutt/1.9.1 (2017-09-22)

Am 13.07.2018 um 09:15 hat Peter Lieven geschrieben:
> the min_sparse convert parameter can overflow (e.g. -S 1024G)
> in the conversion from int64_t to int resulting in a negative
> min_sparse parameter. Avoid this by limiting the valid parameters
> to sane values. In fact anything exceeding the convert buffer size
> is also pointless. While at it also forbid values that are non
> multiple of 512 to avoid undesired behaviour. For instance, values
> between 1 and 511 were legal, but resulted in full allocation.
> Cc: address@hidden
> Signed-off-by: Peter Lieven <address@hidden>
> ---
> V1->V2: - use correct check for sval mod 512 == 0
>         - use BDRV_SECTOR_SIZE macro instead of hardcoded 512

Thanks, applied to the block branch.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]