From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id C5B51A04DD
	for <public@inbox.dpdk.org>; Wed, 28 Oct 2020 11:46:28 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id C4BB9CA1C;
	Wed, 28 Oct 2020 11:46:20 +0100 (CET)
Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com
 [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id 1D929CA18
 for <stable@dpdk.org>; Wed, 28 Oct 2020 11:46:18 +0100 (CET)
Received: by mail-wr1-f68.google.com with SMTP id s9so5138032wro.8
 for <stable@dpdk.org>; Wed, 28 Oct 2020 03:46:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=5oOawL0Nl9q5ockN+sPqDvxMYaYyUsTXgBtFIURfpqM=;
 b=dAPgcDs1YwWx9xq5R0sjjv0TsDZw8uC8suIwJH/BoRG7yLMGKfxoT8JkfYI+kY+0CF
 0HTvr1Kyb6NLxCJnsF2bGY0wErCDoeFXPMzkLD0NZ8wgvzwQdYXe1JkjPdFSFBriyWxK
 mZJruB2RbmRKQmR8rbWCgCTOgji4nrmTHTbxkWc6LmEj8MstjSaog5zC8Mtmqs771m2l
 4uf834Z8z3mGRotDG7aW4OiR8bQt2CrRvZE1O+/R3+mtwBcMQ3+2kTG23ABanq8n2dVz
 yMXKx0uh1Myl1PA8bCQVqUE/mNQ5Bb7EvRQOfAZNt+fTDs9JC/hPVfwSQ7f++YXSxPJB
 zkMQ==
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:mime-version:content-transfer-encoding;
 bh=5oOawL0Nl9q5ockN+sPqDvxMYaYyUsTXgBtFIURfpqM=;
 b=ihmF9BKNKwguNLqZZbdMaXPvwfGyq8AKJyJr6M7uYfMqIYvY5+SrjhIiGkqEi0TRc6
 SX4Mc63uQVrbwE3YPZVkol1qa/phg5Jj7+sf+cnmxeaqrApyi3u71QUa/9DctnjBLzO4
 9nan5MC79BU6WOfraUaJSrnUZlMbquTJFlmWVzTL3FQt4wLyEyc2KF3A7sJNOG8xlEbW
 VeTWmJLFtAKthGur7RxAM1Tdi4ZbciewNDPRabbIFrYG37FaPmQ5XKbnCXlyFvPz4Gn2
 q2xpBa5TbLZMDCy+WIWxyU1YHsykbpPeDWZZhDUMCEKW2x2JVEOwZwexSQYBHnz6soIH
 bAag==
X-Gm-Message-State: AOAM5318PQAYYObfM9M9AJAOgzurdvopbtZQjEl7ZUkOiy0THXuokjZh
 xxzIu7FQRk7oJ9lhmR05IoM=
X-Google-Smtp-Source: ABdhPJxXLmveQ7IgHzrtB+p9la2b+z/sRlIQ2dnjfxeGN5VQIthh5T8pw+1VXfIOeou3yPiQYsxB7A==
X-Received: by 2002:adf:b7c8:: with SMTP id t8mr1037493wre.143.1603881977888; 
 Wed, 28 Oct 2020 03:46:17 -0700 (PDT)
Received: from localhost ([88.98.246.218])
 by smtp.gmail.com with ESMTPSA id i126sm6082592wmi.0.2020.10.28.03.46.17
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Wed, 28 Oct 2020 03:46:17 -0700 (PDT)
From: luca.boccassi@gmail.com
To: Long Li <longli@microsoft.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>,
 dpdk stable <stable@dpdk.org>
Date: Wed, 28 Oct 2020 10:42:44 +0000
Message-Id: <20201028104606.3504127-5-luca.boccassi@gmail.com>
X-Mailer: git-send-email 2.20.1
In-Reply-To: <20201028104606.3504127-1-luca.boccassi@gmail.com>
References: <20201028104606.3504127-1-luca.boccassi@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-stable] patch 'net/netvsc: fix stale value after free' has
	been queued to stable release 19.11.6
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

Hi,

FYI, your patch has been queued to stable release 19.11.6

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

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 4fbf3d1dc57bad4f708ae6c9f5c1b04e06c8db25 Mon Sep 17 00:00:00 2001
From: Long Li <longli@microsoft.com>
Date: Mon, 10 Aug 2020 19:33:13 -0700
Subject: [PATCH] net/netvsc: fix stale value after free

[ upstream commit 0caf5621a4cdaadb40c7686d86bf58dd841057d3 ]

chim_index could potentially be used in other hn_txdesc when re-allocated.
Mark it as invalid to prevent stale value being used.

Fixes: cc0251813277 ("net/netvsc: split send buffers from Tx descriptors")

Signed-off-by: Long Li <longli@microsoft.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/netvsc/hn_rxtx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index 7fb8852797..df15e56120 100644
--- a/drivers/net/netvsc/hn_rxtx.c
+++ b/drivers/net/netvsc/hn_rxtx.c
@@ -387,8 +387,10 @@ hn_nvs_send_completed(struct rte_eth_dev *dev, uint16_t queue_id,
 		++txq->stats.errors;
 	}
 
-	if (txd->chim_index != NVS_CHIM_IDX_INVALID)
+	if (txd->chim_index != NVS_CHIM_IDX_INVALID) {
 		hn_chim_free(hv, txd->chim_index);
+		txd->chim_index = NVS_CHIM_IDX_INVALID;
+	}
 
 	rte_pktmbuf_free(txd->m);
 	hn_txd_put(txq, txd);
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:11.948757510 +0000
+++ 0005-net-netvsc-fix-stale-value-after-free.patch	2020-10-28 10:35:11.388828316 +0000
@@ -1,13 +1,14 @@
-From 0caf5621a4cdaadb40c7686d86bf58dd841057d3 Mon Sep 17 00:00:00 2001
+From 4fbf3d1dc57bad4f708ae6c9f5c1b04e06c8db25 Mon Sep 17 00:00:00 2001
 From: Long Li <longli@microsoft.com>
 Date: Mon, 10 Aug 2020 19:33:13 -0700
 Subject: [PATCH] net/netvsc: fix stale value after free
 
+[ upstream commit 0caf5621a4cdaadb40c7686d86bf58dd841057d3 ]
+
 chim_index could potentially be used in other hn_txdesc when re-allocated.
 Mark it as invalid to prevent stale value being used.
 
 Fixes: cc0251813277 ("net/netvsc: split send buffers from Tx descriptors")
-Cc: stable@dpdk.org
 
 Signed-off-by: Long Li <longli@microsoft.com>
 Acked-by: Stephen Hemminger <stephen@networkplumber.org>
@@ -16,10 +17,10 @@
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
-index c8c4ee10c8..a388ff2588 100644
+index 7fb8852797..df15e56120 100644
 --- a/drivers/net/netvsc/hn_rxtx.c
 +++ b/drivers/net/netvsc/hn_rxtx.c
-@@ -419,8 +419,10 @@ hn_nvs_send_completed(struct rte_eth_dev *dev, uint16_t queue_id,
+@@ -387,8 +387,10 @@ hn_nvs_send_completed(struct rte_eth_dev *dev, uint16_t queue_id,
  		++txq->stats.errors;
  	}