DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: David Marchand <david.marchand@redhat.com>, dev@dpdk.org
Cc: Chenbo Xia <chenbox@nvidia.com>
Subject: Re: [PATCH] vhost: fix virtqueue access lock check for handlers
Date: Mon, 11 Mar 2024 11:42:09 +0100	[thread overview]
Message-ID: <4aff6551-440d-4b13-9eca-2afcaf4d0f61@redhat.com> (raw)
In-Reply-To: <20240307103624.610080-1-david.marchand@redhat.com>



On 3/7/24 11:36, David Marchand wrote:
> As the vhost library may receive a request for an unsupported request,
> it is necessary to check msg_handler before checking if locking queue
> pairs is requested.
> 
> Coverity issue: 415049
> Fixes: 5e8fcc60b59d ("vhost: enhance virtqueue access lock asserts")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>   lib/vhost/vhost_user.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
> index 7fe1687f08..414192500e 100644
> --- a/lib/vhost/vhost_user.c
> +++ b/lib/vhost/vhost_user.c
> @@ -3171,7 +3171,7 @@ vhost_user_msg_handler(int vid, int fd)
>   	 * inactive, so it is safe. Otherwise taking the access_lock
>   	 * would cause a dead lock.
>   	 */
> -	if (msg_handler->lock_all_qps) {
> +	if (msg_handler != NULL && msg_handler->lock_all_qps) {
>   		if (!(dev->flags & VIRTIO_DEV_VDPA_CONFIGURED)) {
>   			vhost_user_lock_all_queue_pairs(dev);
>   			unlock_required = 1;

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


  parent reply	other threads:[~2024-03-11 10:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 10:36 David Marchand
2024-03-07 14:20 ` Kevin Traynor
2024-03-11 10:42 ` Maxime Coquelin [this message]
2024-03-13 14:46 ` David Marchand

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=4aff6551-440d-4b13-9eca-2afcaf4d0f61@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=chenbox@nvidia.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    /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).