Re: [PATCH v4] qcow2-bitmap: Fix uint64_t left-shift overflow

2019-11-05 Thread Max Reitz
On 01.11.19 08:37, Tuguoyi wrote: > There are two issues in In check_constraints_on_bitmap(), > 1) The sanity check on the granularity will cause uint64_t > integer left-shift overflow when cluster_size is 2M and the > granularity is BIGGER than 32K. > 2) The way to calculate image size that the

RE: [PATCH v4] qcow2-bitmap: Fix uint64_t left-shift overflow

2019-11-01 Thread Tuguoyi
On 01.11.2019 18:09, Vladimir Sementsov-Ogievskiy wrote: > 01.11.2019 12:34, Tuguoyi wrote: > > On 01.11.2019 17:25 Vladimir Sementsov-Ogievskiy wrote: > >> 01.11.2019 10:37, Tuguoyi wrote: > >>> There are two issues in In check_constraints_on_bitmap(), > >>> 1) The sanity check on the granularity

Re: [PATCH v4] qcow2-bitmap: Fix uint64_t left-shift overflow

2019-11-01 Thread Vladimir Sementsov-Ogievskiy
01.11.2019 12:34, Tuguoyi wrote: > On 01.11.2019 17:25 Vladimir Sementsov-Ogievskiy wrote: >> 01.11.2019 10:37, Tuguoyi wrote: >>> There are two issues in In check_constraints_on_bitmap(), >>> 1) The sanity check on the granularity will cause uint64_t integer >>> left-shift overflow when

RE: [PATCH v4] qcow2-bitmap: Fix uint64_t left-shift overflow

2019-11-01 Thread Tuguoyi
On 01.11.2019 17:25 Vladimir Sementsov-Ogievskiy wrote: > 01.11.2019 10:37, Tuguoyi wrote: > > There are two issues in In check_constraints_on_bitmap(), > > 1) The sanity check on the granularity will cause uint64_t integer > > left-shift overflow when cluster_size is 2M and the granularity is > >

Re: [PATCH v4] qcow2-bitmap: Fix uint64_t left-shift overflow

2019-11-01 Thread Vladimir Sementsov-Ogievskiy
01.11.2019 10:37, Tuguoyi wrote: > There are two issues in In check_constraints_on_bitmap(), > 1) The sanity check on the granularity will cause uint64_t > integer left-shift overflow when cluster_size is 2M and the > granularity is BIGGER than 32K. > 2) The way to calculate image size that the

[PATCH v4] qcow2-bitmap: Fix uint64_t left-shift overflow

2019-11-01 Thread Tuguoyi
There are two issues in In check_constraints_on_bitmap(), 1) The sanity check on the granularity will cause uint64_t integer left-shift overflow when cluster_size is 2M and the granularity is BIGGER than 32K. 2) The way to calculate image size that the maximum bitmap supported can map to is a bit