[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 2/4] qcow2: fix offset overflow in qcow2_allo
From: |
Hu Tao |
Subject: |
Re: [Qemu-devel] [PATCH v3 2/4] qcow2: fix offset overflow in qcow2_alloc_clusters_at() |
Date: |
Thu, 23 Jan 2014 10:53:04 +0800 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Wed, Jan 22, 2014 at 08:16:44PM +0100, Max Reitz wrote:
> 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>
Thanks for reviewing!