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 EEAB9A04DD for ; Wed, 28 Oct 2020 11:55:25 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D80BFCAB5; Wed, 28 Oct 2020 11:55:24 +0100 (CET) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 7B7CACAAE for ; Wed, 28 Oct 2020 11:55:22 +0100 (CET) Received: by mail-wm1-f66.google.com with SMTP id c194so4099596wme.2 for ; Wed, 28 Oct 2020 03:55:22 -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=yJW2YwoOVSNnhr6jtKNgjbkiCpW39pGf7wVtbcV4GsU=; b=bvfeZw+Vfpgq37Kbz4y65LsZpeXEsUQePI5wZabcY5asLaCtgVnTd7lSY7mdFxOyfC rTtoF05KhfChSw3Ajg3N9067Rhd2g9IsCIGwoZ74kXRGBNOfiO8r1nFfIfjUaFrCemny 5nb3xjnLp2Gb3C0wGH0FA/SWe36qgtOdNC6MhCvq0lDzybQRMAFYz52oB+QpTa5kfyIF k5pnwwW6jUa6KxDasLx/Tm4fAidNtDOClDbqwsOS47zeuw+IWfWLP/9hzef8uPvJhfj8 8FM2FmBYEcc1dcH+0MsdT+G4Eq+9RCUDMlr72t9DotDnoffFJH1pXtfqleXQlgG6wP9f +8Uw== 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=yJW2YwoOVSNnhr6jtKNgjbkiCpW39pGf7wVtbcV4GsU=; b=b7AWYH5A7jNxR87G/mJsvrb1mAcyI7FasP/NqaVT8hUXQFznqwB028H43ARocNufuo NlWKcCX52aPOnXb9dWWdESt5BUmRW6wZFZVqGcyepnSKPpLne7ZX4je3EDw/pJIOLAU5 Eph8Jd4NwRt6gVDWmneglYtyMoAFrPirrUxbZAIus+htB2geGm+SbiuiQiPOcMroBSSm OdqsFya/CN+Z6k1ffyOeFxyhw8RhZT17WxuypEPpfh2C1aI5hmFMYraGXJ8RdJ0JFfNd U6C3RCfH18rLInEKJ4kGm2pCWJ5FOTlxhgZl/EdyifqvMLX2vpnljFdlNZ5HBgicY+ek 9kMA== X-Gm-Message-State: AOAM531Ojp/HN3prrSreMAc6kTHKMEua3gqPQ/WPfNNi/ElCR6/WrU1y TtiZNp9vsnmda2PxqfHjUfQSLLOoKPAIq7b7 X-Google-Smtp-Source: ABdhPJxM7vciOVx3UsAXiNenTW/3zp2n1fk025m0uHZ/kcD3E3Ub6NFouKEeAbahV7D4uQQryFlAZQ== X-Received: by 2002:a05:600c:2888:: with SMTP id g8mr7426731wmd.130.1603882522261; Wed, 28 Oct 2020 03:55:22 -0700 (PDT) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id 30sm6413414wrs.84.2020.10.28.03.55.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 03:55:21 -0700 (PDT) From: luca.boccassi@gmail.com To: Ferruh Yigit Cc: dpdk stable Date: Wed, 28 Oct 2020 10:45:34 +0000 Message-Id: <20201028104606.3504127-175-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/pcap: fix crash on exit for infinite Rx' 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 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 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 8d628c33c4e016f5f06c0550448d4c7bae9209af Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Fri, 9 Oct 2020 16:50:39 +0100 Subject: [PATCH] net/pcap: fix crash on exit for infinite Rx [ upstream commit fbedd8ca9e6807df022af8fde9b1d6d2c87fda6d ] If the infinite Rx argument ('infinite_rx') is provided a ring is allocated and filled in the '.rx_queue_setup' dev_ops. Later this ring freed in the '.dev_close' dev_ops. If the 'infinite_rx' provided and '.dev_close' called before '.rx_queue_setup', the ring will be NULL and trying to empty/free it will cause a crash. This is fixed by adding ring NULL check before trying to empty/free it. Bugzilla ID: 548 Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file") Signed-off-by: Ferruh Yigit --- drivers/net/pcap/rte_eth_pcap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c index 6fb26c8c9d..fbff559c0a 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c @@ -735,6 +735,13 @@ eth_dev_close(struct rte_eth_dev *dev) struct pcap_rx_queue *pcap_q = &internals->rx_queue[i]; struct rte_mbuf *pcap_buf; + /* + * 'pcap_q->pkts' can be NULL if 'eth_dev_close()' + * called before 'eth_rx_queue_setup()' has been called + */ + if (pcap_q->pkts == NULL) + continue; + while (!rte_ring_dequeue(pcap_q->pkts, (void **)&pcap_buf)) rte_pktmbuf_free(pcap_buf); -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-10-28 10:35:17.152151375 +0000 +++ 0175-net-pcap-fix-crash-on-exit-for-infinite-Rx.patch 2020-10-28 10:35:11.784834145 +0000 @@ -1,8 +1,10 @@ -From fbedd8ca9e6807df022af8fde9b1d6d2c87fda6d Mon Sep 17 00:00:00 2001 +From 8d628c33c4e016f5f06c0550448d4c7bae9209af Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Fri, 9 Oct 2020 16:50:39 +0100 Subject: [PATCH] net/pcap: fix crash on exit for infinite Rx +[ upstream commit fbedd8ca9e6807df022af8fde9b1d6d2c87fda6d ] + If the infinite Rx argument ('infinite_rx') is provided a ring is allocated and filled in the '.rx_queue_setup' dev_ops. Later this ring freed in the '.dev_close' dev_ops. @@ -15,7 +17,6 @@ Bugzilla ID: 548 Fixes: a3f5252e5cbd ("net/pcap: enable infinitely Rx a pcap file") -Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- @@ -23,10 +24,10 @@ 1 file changed, 7 insertions(+) diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c -index 057aa9dbfc..49764c0ee6 100644 +index 6fb26c8c9d..fbff559c0a 100644 --- a/drivers/net/pcap/rte_eth_pcap.c +++ b/drivers/net/pcap/rte_eth_pcap.c -@@ -748,6 +748,13 @@ eth_dev_close(struct rte_eth_dev *dev) +@@ -735,6 +735,13 @@ eth_dev_close(struct rte_eth_dev *dev) struct pcap_rx_queue *pcap_q = &internals->rx_queue[i]; struct rte_mbuf *pcap_buf;