From: "Loftus, Ciara" <ciara.loftus@intel.com>
To: Yuanhan Liu <yuanhan.liu@linux.intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH] vhost: fix crash on NUMA
Date: Fri, 2 Jun 2017 14:24:15 +0000 [thread overview]
Message-ID: <74F120C019F4A64C9B78E802F6AD4CC278DA66DD@IRSMSX106.ger.corp.intel.com> (raw)
In-Reply-To: <1496362486-1741-1-git-send-email-yuanhan.liu@linux.intel.com>
> The queue allocation was changed, from allocating one queue-pair at a
> time to one queue at a time. Most of the changes have been done, but
> just with one being missed: the size of coping the old queue is still
> based on queue-pair at numa_realloc(), which leads to overwritten issue.
> As a result, crash may happen.
>
> Fix it by specifying the right copy size. Also, the net queue macros
> are not used any more. Remove them.
>
> Fixes: ab4d7b9f1afc ("vhost: turn queue pair to vring")
>
> Cc: stable@dpdk.org
> Reported-by: Ciara Loftus <ciara.loftus@intel.com>
> Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Tested-by: Ciara Loftus <ciara.loftus@intel.com>
> ---
> lib/librte_vhost/vhost_user.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index 5c8058b..e486b78 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -238,8 +238,6 @@ numa_realloc(struct virtio_net *dev, int index)
> struct vhost_virtqueue *old_vq, *vq;
> int ret;
>
> - enum {VIRTIO_RXQ, VIRTIO_TXQ, VIRTIO_QNUM};
> -
> old_dev = dev;
> vq = old_vq = dev->virtqueue[index];
>
> @@ -261,7 +259,7 @@ numa_realloc(struct virtio_net *dev, int index)
> if (!vq)
> return dev;
>
> - memcpy(vq, old_vq, sizeof(*vq) * VIRTIO_QNUM);
> + memcpy(vq, old_vq, sizeof(*vq));
> rte_free(old_vq);
> }
>
> --
> 2.8.1
prev parent reply other threads:[~2017-06-02 14:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-02 0:14 [dpdk-stable] " Yuanhan Liu
2017-06-02 8:20 ` [dpdk-stable] [dpdk-dev] " Jens Freimann
2017-06-04 3:08 ` Yuanhan Liu
2017-06-02 14:24 ` Loftus, Ciara [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=74F120C019F4A64C9B78E802F6AD4CC278DA66DD@IRSMSX106.ger.corp.intel.com \
--to=ciara.loftus@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
--cc=yuanhan.liu@linux.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).