On Thu, 8 Jan 2026 at 14:50, Maxime Coquelin <[email protected]> wrote:
>
> The mmap() function returns MAP_FAILED on failure, not NULL.
> The current check for !mmap_addr will never detect mmap failures.
>
> When mmap fails but the error is not detected, an invalid address (-1)
> is inserted into the IOTLB cache via vhost_user_iotlb_cache_insert().
> Subsequent attempts to access this address will cause memory
> corruption or crash.
>
> Fix by checking for MAP_FAILED instead of NULL. Also add strerror to
> the error message for easier debugging.
>
> Fixes: f27d5206c598 ("vhost: add VDUSE callback for IOTLB miss")
> Cc: [email protected]
>
> Signed-off-by: Maxime Coquelin <[email protected]>

Ugh.. I should have caught it when reviewing initial commit..
Reviewed-by: David Marchand <[email protected]>


-- 
David Marchand

Reply via email to