Re: [PATCH] vhost_vdpa: Fix potential underflow in vhost_vdpa_mmap()

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 11:58:52AM +0300, Dan Carpenter wrote: > The "vma->vm_pgoff" variable is an unsigned long so if it's larger than > INT_MAX then "index" can be negative leading to an underflow. Fix this > by changing the type of "index" to "unsigned long". > > Fixes: ddd89d0a059d

[PATCH] vhost_vdpa: Fix potential underflow in vhost_vdpa_mmap()

2020-06-10 Thread Dan Carpenter
The "vma->vm_pgoff" variable is an unsigned long so if it's larger than INT_MAX then "index" can be negative leading to an underflow. Fix this by changing the type of "index" to "unsigned long". Fixes: ddd89d0a059d ("vhost_vdpa: support doorbell mapping via mmap") Signed-off-by: Dan Carpenter