Skip to content
Commit c09cc2c3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Michael S. Tsirkin
Browse files

vhost_vdpa: Fix potential underflow in vhost_vdpa_mmap()

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: ddd89d0a

 ("vhost_vdpa: support doorbell mapping via mmap")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/20200610085852.GB5439@mwanda


Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 24eae8eb
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment