From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
"dev@dpdk.org" <dev@dpdk.org>,
"Wang, Yinan" <yinan.wang@intel.com>,
"Ling, WeiX" <weix.ling@intel.com>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] vhost: fix crash on reconnect
Date: Wed, 28 Jul 2021 06:51:03 +0000 [thread overview]
Message-ID: <MN2PR11MB4063D39D17D507387AEA1D999CEA9@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210726075814.287469-1-maxime.coquelin@redhat.com>
> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Monday, July 26, 2021 3:58 PM
> To: dev@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>; Wang, Yinan
> <yinan.wang@intel.com>; Ling, WeiX <weix.ling@intel.com>
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; stable@dpdk.org
> Subject: [PATCH] vhost: fix crash on reconnect
>
> When the vhost-user frontend like Virtio-user tries to
> reconnect to the restarted Vhost backend, the Vhost backend
> segfaults when multiqueue is enabled.
>
> This is caused by VHOST_USER_GET_VRING_BASE being called for
> a virtqueue that has not been created before, causing a NULL
> pointer dereferencing.
>
> This patch adds the VHOST_USER_GET_VRING_BASE requests to
> the list of requests that trigger queue pair allocations.
>
> Fixes: 160cbc815b41 ("vhost: remove a hack on queue allocation")
> Cc: stable@dpdk.org
>
> Reported-by: Yinan Wang <yinan.wang@intel.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
> lib/vhost/vhost_user.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c
> index 433f412fa8..29a4c9af60 100644
> --- a/lib/vhost/vhost_user.c
> +++ b/lib/vhost/vhost_user.c
> @@ -2796,6 +2796,7 @@ vhost_user_check_and_alloc_queue_pair(struct virtio_net
> *dev,
> break;
> case VHOST_USER_SET_VRING_NUM:
> case VHOST_USER_SET_VRING_BASE:
> + case VHOST_USER_GET_VRING_BASE:
> case VHOST_USER_SET_VRING_ENABLE:
> vring_idx = msg->payload.state.index;
> break;
> --
> 2.31.1
Applied to next-virtio/main. Thanks!
prev parent reply other threads:[~2021-07-28 6:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 7:58 Maxime Coquelin
2021-07-26 8:13 ` Wang, Yinan
2021-07-27 1:58 ` Xia, Chenbo
2021-07-28 6:51 ` Xia, Chenbo [this message]
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=MN2PR11MB4063D39D17D507387AEA1D999CEA9@MN2PR11MB4063.namprd11.prod.outlook.com \
--to=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
--cc=weix.ling@intel.com \
--cc=yinan.wang@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).