From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7AD93A04F1 for ; Fri, 5 Jun 2020 20:27:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 62ACE1D525; Fri, 5 Jun 2020 20:27:03 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id E9EBB1D525 for ; Fri, 5 Jun 2020 20:27:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591381621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=29eaaY+cDDhWksbPQnIOddKOz2MGnSc8B/c3zbvmZ3o=; b=Vj4rJtEknHTh6oaImLEqCQlR0FqumLpZabOxxM1OhgTs05E9q1BD6s2wxu5KlBR3c5K2Y2 SkqCN3QPOFn1DMz7iw3WRr/yGySUx3mNC+Afl7oDeZlgesNU3cxloALvwwhDm1AyuO2lXt qJT67Itl1fkeltFLZlGswRqJ5hJvN0I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-101-eL9VwCDMNbecNp1BGyjEtw-1; Fri, 05 Jun 2020 14:26:57 -0400 X-MC-Unique: eL9VwCDMNbecNp1BGyjEtw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 823641005510; Fri, 5 Jun 2020 18:26:56 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9F8F561983; Fri, 5 Jun 2020 18:26:55 +0000 (UTC) From: Kevin Traynor To: Stephen Hemminger Cc: Ferruh Yigit , dpdk stable Date: Fri, 5 Jun 2020 19:24:34 +0100 Message-Id: <20200605182525.22483-37-ktraynor@redhat.com> In-Reply-To: <20200605182525.22483-1-ktraynor@redhat.com> References: <20200605182525.22483-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/tap: fix crash in flow destroy' has been queued to LTS release 18.11.9 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.9 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/10/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. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/38a16ce6529150af6431e6b879306c6d54e23b20 Thanks. Kevin. --- >From 38a16ce6529150af6431e6b879306c6d54e23b20 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 27 Apr 2020 14:39:26 -0700 Subject: [PATCH] net/tap: fix crash in flow destroy [ upstream commit 8451387df206f5ad34461280ab6a2e5bfe382b9b ] The TAP driver does not initialize all the elements of the rte_flow structure. This can lead to crash in rte_flow_destroy. (gdb) where flow=0x100e99280, error=0x0) at drivers/net/tap/tap_flow.c:1514 (gdb) p remote_flow $1 = (struct rte_flow *) 0x6b6b6b6b6b6b6b6b Which is here: static int tap_flow_destroy_pmd(struct pmd_internals *pmd, struct rte_flow *flow, struct rte_flow_error *error) { struct rte_flow *remote_flow = flow->remote_flow; ... if (remote_flow) { remote_flow->msg.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK; Simplest fix is to use rte_zmalloc() so remote_flow and other fields are always set at zero. Fixes: 2bc06869cd94 ("net/tap: add remote netdevice traffic capture") Signed-off-by: Stephen Hemminger Reviewed-by: Ferruh Yigit --- drivers/net/tap/tap_flow.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c index d155618fc8..0c5043b63f 100644 --- a/drivers/net/tap/tap_flow.c +++ b/drivers/net/tap/tap_flow.c @@ -1379,5 +1379,5 @@ tap_flow_create(struct rte_eth_dev *dev, goto fail; } - flow = rte_malloc(__func__, sizeof(struct rte_flow), 0); + flow = rte_zmalloc(__func__, sizeof(struct rte_flow), 0); if (!flow) { rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE, @@ -1415,5 +1415,5 @@ tap_flow_create(struct rte_eth_dev *dev, */ if (pmd->remote_if_index) { - remote_flow = rte_malloc(__func__, sizeof(struct rte_flow), 0); + remote_flow = rte_zmalloc(__func__, sizeof(struct rte_flow), 0); if (!remote_flow) { rte_flow_error_set( @@ -1692,5 +1692,5 @@ int tap_flow_implicit_create(struct pmd_internals *pmd, }; - remote_flow = rte_malloc(__func__, sizeof(struct rte_flow), 0); + remote_flow = rte_zmalloc(__func__, sizeof(struct rte_flow), 0); if (!remote_flow) { TAP_LOG(ERR, "Cannot allocate memory for rte_flow"); @@ -1895,5 +1895,5 @@ static int rss_enable(struct pmd_internals *pmd, } - rss_flow = rte_malloc(__func__, sizeof(struct rte_flow), 0); + rss_flow = rte_zmalloc(__func__, sizeof(struct rte_flow), 0); if (!rss_flow) { TAP_LOG(ERR, -- 2.21.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-06-05 19:20:52.882412244 +0100 +++ 0037-net-tap-fix-crash-in-flow-destroy.patch 2020-06-05 19:20:50.784041404 +0100 @@ -1 +1 @@ -From 8451387df206f5ad34461280ab6a2e5bfe382b9b Mon Sep 17 00:00:00 2001 +From 38a16ce6529150af6431e6b879306c6d54e23b20 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 8451387df206f5ad34461280ab6a2e5bfe382b9b ] + @@ -31 +32,0 @@ -Cc: stable@dpdk.org @@ -40 +41 @@ -index 9d90361d99..1538349e9c 100644 +index d155618fc8..0c5043b63f 100644 @@ -43 +44 @@ -@@ -1381,5 +1381,5 @@ tap_flow_create(struct rte_eth_dev *dev, +@@ -1379,5 +1379,5 @@ tap_flow_create(struct rte_eth_dev *dev, @@ -50 +51 @@ -@@ -1417,5 +1417,5 @@ tap_flow_create(struct rte_eth_dev *dev, +@@ -1415,5 +1415,5 @@ tap_flow_create(struct rte_eth_dev *dev, @@ -57 +58 @@ -@@ -1694,5 +1694,5 @@ int tap_flow_implicit_create(struct pmd_internals *pmd, +@@ -1692,5 +1692,5 @@ int tap_flow_implicit_create(struct pmd_internals *pmd, @@ -64 +65 @@ -@@ -1897,5 +1897,5 @@ static int rss_enable(struct pmd_internals *pmd, +@@ -1895,5 +1895,5 @@ static int rss_enable(struct pmd_internals *pmd,