[dpdk-stable] patch 'net/virtio: fix queues pointer check' has been queued to stable release 18.02.2

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Apr 30 16:03:56 CEST 2018


Hi,

FYI, your patch has been queued to stable release 18.02.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/02/18. So please
shout if anyone has objections.

Thanks.

Luca Boccassi

---
>From 57b1aaa5c84333d5c8a89346e0a81e9d7a35a2dd Mon Sep 17 00:00:00 2001
From: Zhiyong Yang <zhiyong.yang at intel.com>
Date: Wed, 21 Mar 2018 11:03:40 +0800
Subject: [PATCH] net/virtio: fix queues pointer check

[ upstream commit 7c7f2e6088aeb24d9ffbf41d1076512ca8da8a85 ]

It is necessary to add pointer checking because in some case the
code will cause crash. For example, the code goes here before
memory allocation of rxvq is finished.

Fixes: 7365504f77e3 ("net/virtio: support guest announce")

Signed-off-by: Zhiyong Yang <zhiyong.yang at intel.com>
Reviewed-by: Jianfeng Tan <jianfeng.tan at intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 drivers/net/virtio/virtio_ethdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 884f74ad0..f377d8aa3 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1273,9 +1273,13 @@ static void
 virtio_notify_peers(struct rte_eth_dev *dev)
 {
 	struct virtio_hw *hw = dev->data->dev_private;
-	struct virtnet_rx *rxvq = dev->data->rx_queues[0];
+	struct virtnet_rx *rxvq;
 	struct rte_mbuf *rarp_mbuf;
 
+	if (!dev->data->rx_queues)
+		return;
+
+	rxvq = dev->data->rx_queues[0];
 	rarp_mbuf = rte_net_make_rarp_packet(rxvq->mpool,
 			(struct ether_addr *)hw->mac_addr);
 	if (rarp_mbuf == NULL) {
-- 
2.14.2



More information about the stable mailing list