From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by dpdk.org (Postfix) with ESMTP id 2001E325A for ; Tue, 20 Jun 2017 13:38:36 +0200 (CEST) Received: by mail-pg0-f67.google.com with SMTP id u62so15050644pgb.0 for ; Tue, 20 Jun 2017 04:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QkHKDh22Xeu23T/fgtT2XJjy3m4TL1TBuuQzew1HCDg=; b=KpUS5ZgDCx8zmydr1+C18Mptf4rv2X4R1vX5fF7t6j6ss/L+FgBXD3Ssko5GH8jc9C 4ncmfgBJzDsHPtBlldiuTADJEmMpENKF3/Ye6u6/dMiG1O3FnnmBDvkJ/epVbps2oUAs NUxVBKb1Njs6PSLslaGpGg6zIT2l7IkrtMcVYGpumFZD47FoWuXcKdbpMm7KdKn1E8FD tg+5zvZXU6AA2oKAiw35+m9jeo6n+THWKNS3VaQR7DHvpHMG/sWby1gZPVhKGKonyJCq 4XHIzo4zQErtE1QR0LT+Z5zVFx8KzzEWid3dsItg7SzjcAP0dMtQs2s5ByJ0Egc02bKA 7tpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QkHKDh22Xeu23T/fgtT2XJjy3m4TL1TBuuQzew1HCDg=; b=UhAXhX9Is/e3gYDhuE6/7IYziinzMXs5shMbOpYnLGgWBu7WArymh3BRua4mUZPGEp +wszvLgtgIY1RGE+SXCz9YtrzjyDZIsAR8XrnLx4K/5pkR6ZexuV36Hrr3Etv2yOONZ5 4rkbG7McYnL20SIXwMUSz7od+4WSwKSWZ+U6CN939TeTMpUsMdXHKTnfyLfh2iwjvZYA /EHCj/M0S80GT8KxR3rTWwgtBlC7+28i9ZMwSH3xaSRMx3fB4ggLxS9hhDKMWToSkYxQ EEODAfN3k6nUREHEUiv07vuOlbN7qEZdnlsfW/+eV81o3iVeGbKztlArC+jS79yNtOIo +EBA== X-Gm-Message-State: AKS2vOwAh2IMK9sOUWhkRhL77pna12c4/titqr5mII8FbLJF7wTBrz7q AGh4mzxXm+IQifin X-Received: by 10.84.134.36 with SMTP id 33mr34848858plg.29.1497958715475; Tue, 20 Jun 2017 04:38:35 -0700 (PDT) Received: from yliu-home.localdomain ([45.63.61.64]) by smtp.gmail.com with ESMTPSA id 25sm6104783pfj.59.2017.06.20.04.38.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Jun 2017 04:38:34 -0700 (PDT) From: Yuanhan Liu To: Yuanhan Liu Cc: Ciara Loftus , Jens Freimann , dpdk stable Date: Tue, 20 Jun 2017 19:35:48 +0800 Message-Id: <1497958550-13600-36-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> References: <1497958550-13600-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'vhost: fix crash on NUMA' has been queued to stable release 17.05.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jun 2017 11:38:36 -0000 Hi, FYI, your patch has been queued to stable release 17.05.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/22/17. So please shout if anyone has objections. Thanks. --yliu --- >>From 47d21fc57a6b52afbfc161001ea429125edbeb7b Mon Sep 17 00:00:00 2001 From: Yuanhan Liu Date: Fri, 2 Jun 2017 08:14:46 +0800 Subject: [PATCH] vhost: fix crash on NUMA [ upstream commit ebd792b386097d40164c81e055a18f1adfa95d8d ] 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 copying 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") Reported-by: Ciara Loftus Signed-off-by: Yuanhan Liu Reviewed-by: Jens Freimann Tested-by: Ciara Loftus --- 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 2cc0b66..2880881 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -242,8 +242,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]; @@ -265,7 +263,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.7.4