[dpdk-dev] [PATCH] vhost: fix async DMA map

Maxime Coquelin maxime.coquelin at redhat.com
Mon Oct 25 22:47:14 CEST 2021


Hi Xuan,

On 10/25/21 22:33, Maxime Coquelin wrote:
> This patch fixes possible NULL-pointer dereferencing
> reported by Coverity and also fixes NUMA reallocation
> of the async DMA map.
> 
> Fixes: 7c61fa08b716 ("vhost: enable IOMMU for async vhost")
> 
> Coverity issue: 373655
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>
> ---
>   lib/vhost/vhost_user.c | 45 +++++++++++++++++++-----------------------
>   1 file changed, 20 insertions(+), 25 deletions(-)
> 

I posted this patch to fix the issue reported by Coverity and also other
issue on NUMA realloc that I found at the same time. But I wonder
whether all this async_map_status is needed.

Indeed, if the only place where we DMA map is in
vhost_user_mmap_region(). If it fails, the error is propagated, the mem
table are freed and NACK is replied to the master. IOW, the device will
be in an unusable state.

Removing the async DMA map will simplify a lot the code, do you agree to
remove it or there is something I missed?

Thanks,
Maxime



More information about the dev mailing list