Re: [Qemu-devel] [PATCH v5 4/5] qcow2: Don't allow overflow during cluster allocation

2018-04-25 Thread Eric Blake
On 04/25/2018 09:44 AM, Max Reitz wrote: > Here's what you do: > (1) Create a 513 TB image with cluster_size=2M,refcount_bits=1 > (2) Take a hex editor and enter 16 refblocks into the reftable > (3) Fill all of those refblocks with 1s > > (Funny side note: qemu-img check thinks that image is clea

Re: [Qemu-devel] [PATCH v5 4/5] qcow2: Don't allow overflow during cluster allocation

2018-04-25 Thread Eric Blake
On 04/25/2018 09:44 AM, Max Reitz wrote: > On 2018-04-24 00:33, Eric Blake wrote: >> Our code was already checking that we did not attempt to >> allocate more clusters than what would fit in an INT64 (the >> physical maximimum if we can access a full off_t's worth of s/maximimum/maximum/ >> data)

Re: [Qemu-devel] [PATCH v5 4/5] qcow2: Don't allow overflow during cluster allocation

2018-04-25 Thread Max Reitz
On 2018-04-24 00:33, Eric Blake wrote: > Our code was already checking that we did not attempt to > allocate more clusters than what would fit in an INT64 (the > physical maximimum if we can access a full off_t's worth of > data). But this does not catch smaller limits enforced by > various spots

[Qemu-devel] [PATCH v5 4/5] qcow2: Don't allow overflow during cluster allocation

2018-04-23 Thread Eric Blake
Our code was already checking that we did not attempt to allocate more clusters than what would fit in an INT64 (the physical maximimum if we can access a full off_t's worth of data). But this does not catch smaller limits enforced by various spots in the qcow2 image description: L1 and normal clu