nutanix / libvfio-user

framework for emulating devices in userspace
BSD 3-Clause "New" or "Revised" License
166 stars 51 forks source link

mmap_len in dma_map_region may be incorrect #730

Open tmakatos opened 1 year ago

tmakatos commented 1 year ago

Reported by miao.li@intel.com on Slack:

the value of mmap_len in dma_map_region may be incorrect. For example, the page size is 0x100, offset is 0xf0, mmap_len is 0x120, the map area is 0xf0~0x210. Through calculation of page align in dma_map_region, the offset will be 0x00, mmap_len will be 0x200, the map area will be 0x00~0x200, 0x200~0x210 will not be mapped.