From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 40F7D1B1A8 for ; Wed, 24 Jan 2018 16:38:56 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id E35FB226CC; Wed, 24 Jan 2018 10:38:55 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Wed, 24 Jan 2018 10:38:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fridaylinux.org; h=cc:date:from:in-reply-to:message-id:references:subject:to :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=iqDiNHsYKaQp0JYtl raVILr87eTEzFW6wK4AIOH7XDs=; b=PViM94j5JUWPwaZswznkEivPfohLr6Hea YqBplmR6WCbRSR4J0WW9XoHhPOF8cJcf5xG3DDbD6cMfHYzQ/WhKbZuupL1aDet1 USGxIkDY46LxjUiCjIOzJOZ8w/03AakLRqnyF/RoxS0HpQJDrbW8MfId69RdyAdE 9b7Qc60NT9FTeyv8wce/0Q4fuCrR/On6FerKbh46BJ8/tj7TC+ieMw50VX4xzXnm Aol4D2AmZ2/mQtqHtwKNkQ5fXE2FV8GYIbDMy8nksKy1AHNf8puwbnOVBMF+lnNn dBQIJnLXTji3cvgTwD+nT474AIoL8HpSMOBTh96XXrW0XIYwAT+xg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=iqDiNHsYKaQp0JYtlraVILr87eTEzFW6wK4AIOH7XDs=; b=i/Wc0T2+ CLtEkNzJKrPGyN5fVU1ByNwPOC4wMET/VHdyusk15iHPsI7N3D3T4mfFJ1OWilmF WZyM83txRD1hbxyTPcpT9prQX4FUHTzQgTEgFyXXxxz/kILTr698Gnp/2Lq/jrEG pN9C+cbQIaxDsgqLuMTLC/G/WKK9B/3GsRej9PpKFS7a4oEzBChtLVGRlGKJIiEZ Qf7cZdWcQqjYzKt/+QHBMqB8+x+w9zrCnE+SriYKWbtYZVC0LcPF1BeYMgeyiruz XBDIivvvCo9J1kHMWUY5NAvb6wYx/l6i/lTvqgfeGQ55X5eNNuOE7GctFGtHNiAe 6DZrF7Nu1avx8A== X-ME-Sender: Received: from localhost.localdomain (unknown [115.150.27.206]) by mail.messagingengine.com (Postfix) with ESMTPA id F388F7E3D4; Wed, 24 Jan 2018 10:38:52 -0500 (EST) From: Yuanhan Liu To: Didier Pallard Cc: Olivier Matz , Maxime Coquelin , Yuanhan Liu , dpdk stable Date: Wed, 24 Jan 2018 23:32:16 +0800 Message-Id: <1516808026-25523-68-git-send-email-yliu@fridaylinux.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> References: <1516808026-25523-1-git-send-email-yliu@fridaylinux.org> Subject: [dpdk-stable] patch 'net/virtio: fix incorrect cast' has been queued to LTS release 17.11.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: Wed, 24 Jan 2018 15:38:56 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.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 01/26/18. So please shout if anyone has objections. Thanks. --yliu --- >>From faee0665f376a685ca63304f3d10d55ab7f1d86d Mon Sep 17 00:00:00 2001 From: Didier Pallard Date: Thu, 14 Dec 2017 15:33:43 +0100 Subject: [PATCH] net/virtio: fix incorrect cast [ upstream commit 43ec842ca45d1b090998aff20c64eb92cc8bdf0b ] The rx_queues and tx_queues fields of the data structure points to a struct virtnet_rx or virtnet_tx. Casting it to a virtqueue is an error. It does not trigger any bug because pointer is not dereferenced inside the function, but it can become a bug if this code is copy/pasted and vq is dereferenced. Fixes: 01ad44fd374f ("net/virtio: split Rx/Tx queue") Signed-off-by: Didier Pallard Signed-off-by: Olivier Matz Reviewed-by: Maxime Coquelin Acked-by: Yuanhan Liu --- drivers/net/virtio/virtio_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index e0328f6..770c039 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -893,7 +893,7 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev, /* Note: limit checked in rte_eth_xstats_names() */ for (i = 0; i < dev->data->nb_rx_queues; i++) { - struct virtqueue *rxvq = dev->data->rx_queues[i]; + struct virtnet_rx *rxvq = dev->data->rx_queues[i]; if (rxvq == NULL) continue; for (t = 0; t < VIRTIO_NB_RXQ_XSTATS; t++) { @@ -906,7 +906,7 @@ static int virtio_dev_xstats_get_names(struct rte_eth_dev *dev, } for (i = 0; i < dev->data->nb_tx_queues; i++) { - struct virtqueue *txvq = dev->data->tx_queues[i]; + struct virtnet_tx *txvq = dev->data->tx_queues[i]; if (txvq == NULL) continue; for (t = 0; t < VIRTIO_NB_TXQ_XSTATS; t++) { -- 2.7.4