DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: dev@dpdk.org, david.marchand@redhat.com, chenbo.xia@intel.com,
	xuan.ding@intel.com
Subject: Re: [dpdk-dev] [PATCH] vhost: fix async DMA map
Date: Mon, 25 Oct 2021 22:47:14 +0200	[thread overview]
Message-ID: <fb5ddef6-6bfd-8f05-6612-7e2a931e1a8b@redhat.com> (raw)
In-Reply-To: <20211025203353.147346-1-maxime.coquelin@redhat.com>

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@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


  reply	other threads:[~2021-10-25 20:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-25 20:33 Maxime Coquelin
2021-10-25 20:47 ` Maxime Coquelin [this message]
2021-10-26  2:07   ` Ding, Xuan
2021-10-26  6:52     ` Maxime Coquelin
2021-10-26  8:49       ` Ding, Xuan
2021-10-26  9:49         ` Maxime Coquelin
2021-10-26 10:27           ` Ding, Xuan
2021-10-26 10:58             ` Burakov, Anatoly
2021-10-26 15:24               ` Burakov, Anatoly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fb5ddef6-6bfd-8f05-6612-7e2a931e1a8b@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=xuan.ding@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).