Re: [Qemu-devel] [PATCH v2] vfio/common: Check iova with limit not with size

2016-01-12 Thread Pierre Morel
On 01/06/2016 08:08 PM, Alex Williamson wrote: On Tue, 2016-01-05 at 17:03 +0100, Pierre Morel wrote: In vfio_listener_region_add(), the code makes sure that the offset in the section is lower than the size of the section. But the calculation uses size of the region instead of the region's lim

Re: [Qemu-devel] [PATCH v2] vfio/common: Check iova with limit not with size

2016-01-06 Thread Alex Williamson
On Tue, 2016-01-05 at 17:03 +0100, Pierre Morel wrote: > In vfio_listener_region_add(), the code makes sure > that the offset in the section is lower than the size > of the section. > But the calculation uses size of the region instead of > the region's limit (size - 1). We're really just trying t

[Qemu-devel] [PATCH v2] vfio/common: Check iova with limit not with size

2016-01-05 Thread Pierre Morel
In vfio_listener_region_add(), the code makes sure that the offset in the section is lower than the size of the section. But the calculation uses size of the region instead of the region's limit (size - 1). This leads to Int128 overflow when the region has been initialized to UINT64_MAX because in