|
From: | Max Reitz |
Subject: | Re: [Qemu-devel] [PATCH v3 2/4] qcow2: fix offset overflow in qcow2_alloc_clusters_at() |
Date: | Wed, 22 Jan 2014 20:16:44 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 |
On 22.01.2014 07:57, Hu Tao wrote:
When cluster size is big enough it can lead offset overflow in qcow2_alloc_clusters_at(). This patch fixes it. The allocation each time is stopped at L2 table boundary (see handle_alloc()), so the possible maximum bytes could be 2^(cluster_bits - 3 + cluster_bits) so int is safe for cluster_bits<=17, unsafe otherwise. Signed-off-by: Hu Tao <address@hidden> --- block/qcow2-refcount.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
Reviewed-by: Max Reitz <address@hidden>
[Prev in Thread] | Current Thread | [Next in Thread] |