patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Yunjian Wang <wangyunjian@huawei.com>
Cc: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,
	Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,
	dpdk stable <stable@dpdk.org>
Subject: patch 'ring: fix use after free' has been queued to stable release 21.11.5
Date: Thu, 20 Jul 2023 16:17:15 +0100	[thread overview]
Message-ID: <20230720151942.262154-4-ktraynor@redhat.com> (raw)
In-Reply-To: <20230720151942.262154-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to stable release 21.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/25/23. 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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/096ec31efd0f93756bbb4fe4d0876aef162a656c

Thanks.

Kevin

---
From 096ec31efd0f93756bbb4fe4d0876aef162a656c Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian@huawei.com>
Date: Fri, 5 May 2023 14:48:34 +0800
Subject: [PATCH] ring: fix use after free

[ upstream commit ce4bd6e14aa693c80c5218f7d896c98b3b85b54a ]

After the memzone is freed, it is not removed from the 'rte_ring_tailq'.
If rte_ring_lookup is called at this time, it will cause a use-after-free
problem. This change prevents that from happening.

Fixes: 4e32101f9b01 ("ring: support freeing")

Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
---
 lib/ring/rte_ring.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
index 6a94a038c4..40d29c1bc5 100644
--- a/lib/ring/rte_ring.c
+++ b/lib/ring/rte_ring.c
@@ -342,9 +342,4 @@ rte_ring_free(struct rte_ring *r)
 	}
 
-	if (rte_memzone_free(r->memzone) != 0) {
-		RTE_LOG(ERR, RING, "Cannot free memory\n");
-		return;
-	}
-
 	ring_list = RTE_TAILQ_CAST(rte_ring_tailq.head, rte_ring_list);
 	rte_mcfg_tailq_write_lock();
@@ -365,4 +360,7 @@ rte_ring_free(struct rte_ring *r)
 	rte_mcfg_tailq_write_unlock();
 
+	if (rte_memzone_free(r->memzone) != 0)
+		RTE_LOG(ERR, RING, "Cannot free memory\n");
+
 	rte_free(te);
 }
-- 
2.41.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2023-07-20 16:17:55.681995558 +0100
+++ 0004-ring-fix-use-after-free.patch	2023-07-20 16:17:54.415749503 +0100
@@ -1 +1 @@
-From ce4bd6e14aa693c80c5218f7d896c98b3b85b54a Mon Sep 17 00:00:00 2001
+From 096ec31efd0f93756bbb4fe4d0876aef162a656c Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ce4bd6e14aa693c80c5218f7d896c98b3b85b54a ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -21 +22 @@
-index 8ed455043d..057d25ff6f 100644
+index 6a94a038c4..40d29c1bc5 100644
@@ -24 +25 @@
-@@ -334,9 +334,4 @@ rte_ring_free(struct rte_ring *r)
+@@ -342,9 +342,4 @@ rte_ring_free(struct rte_ring *r)
@@ -34 +35 @@
-@@ -357,4 +352,7 @@ rte_ring_free(struct rte_ring *r)
+@@ -365,4 +360,7 @@ rte_ring_free(struct rte_ring *r)


  parent reply	other threads:[~2023-07-20 15:22 UTC|newest]

Thread overview: 144+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-20 15:17 patch 'kni: fix build with Linux 6.3' " Kevin Traynor
2023-07-20 15:17 ` patch 'examples/ip_pipeline: fix build with GCC 13' " Kevin Traynor
2023-07-20 15:17 ` patch 'examples/ntb: " Kevin Traynor
2023-07-20 15:17 ` Kevin Traynor [this message]
2023-07-20 15:17 ` patch 'vfio: fix include with musl runtime' " Kevin Traynor
2023-07-20 15:17 ` patch 'kernel/freebsd: fix function parameter list' " Kevin Traynor
2023-07-20 15:17 ` patch 'build: fix case of project language name' " Kevin Traynor
2023-07-20 15:17 ` patch 'telemetry: fix autotest on Alpine' " Kevin Traynor
2023-07-20 15:17 ` patch 'ring: fix dequeue parameter name' " Kevin Traynor
2023-07-20 15:17 ` patch 'pipeline: fix double free for table stats' " Kevin Traynor
2023-07-20 15:17 ` patch 'test/malloc: fix missing free' " Kevin Traynor
2023-07-20 15:17 ` patch 'test/malloc: fix statistics checks' " Kevin Traynor
2023-07-20 15:17 ` patch 'eal: avoid calling cleanup twice' " Kevin Traynor
2023-07-20 15:17 ` patch 'pci: fix comment referencing renamed function' " Kevin Traynor
2023-07-20 15:17 ` patch 'eventdev/timer: fix timeout event wait behavior' " Kevin Traynor
2023-07-20 15:17 ` patch 'doc: fix event timer adapter guide' " Kevin Traynor
2023-07-20 15:17 ` patch 'event/dsw: free rings on close' " Kevin Traynor
2023-07-20 15:17 ` patch 'eventdev/timer: fix buffer flush' " Kevin Traynor
2023-07-20 15:17 ` patch 'event/cnxk: fix nanoseconds to ticks conversion' " Kevin Traynor
2023-07-20 15:17 ` patch 'eal/linux: fix secondary process crash for mp hotplug' " Kevin Traynor
2023-07-20 15:17 ` patch 'eal/linux: fix legacy mem init with many segments' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix build warning' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/sfc: stop misuse of Rx ingress m-port metadata on EF100' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/tap: set locally administered bit for fixed MAC address' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/dpaa2: fix checksum good flags' " Kevin Traynor
2023-07-20 15:17 ` patch 'app/testpmd: fix GTP L2 length in checksum engine' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/vmxnet3: fix drop of empty segments in Tx' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/txgbe: fix use-after-free on remove' " Kevin Traynor
2023-07-20 15:17 ` patch 'ethdev: fix MAC address occupies two entries' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/sfc: invalidate dangling MAE flow action FW resource IDs' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix never set MAC flow control' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix variable type mismatch' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix Rx multiple firmware reset interrupts' " Kevin Traynor
2023-07-20 15:17 ` patch 'ethdev: fix indirect action conversion' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix FEC mode for 200G ports' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix FEC mode check' " Kevin Traynor
2023-07-20 15:17 ` patch 'doc: fix format in flow API guide' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix RTC time on initialization' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix RTC time after reset' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: uninitialize PTP' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: extract PTP to its own header file' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix mbuf leakage when RxQ started during reset' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix mbuf leakage when RxQ started after " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix device start return value' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix uninitialized variable' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix inaccurate log' " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix redundant line break in " Kevin Traynor
2023-07-20 15:17 ` patch 'net/hns3: fix IMP reset trigger' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/vmxnet3: fix return code in initializing' " Kevin Traynor
2023-07-20 15:18 ` patch 'doc: fix auth algos in cryptoperf app' " Kevin Traynor
2023-07-20 15:18 ` patch 'crypto/scheduler: fix last element for valid args' " Kevin Traynor
2023-07-20 15:18 ` patch 'test/crypto: fix return value for SNOW3G' " Kevin Traynor
2023-07-20 15:18 ` patch 'test/crypto: fix session creation check' " Kevin Traynor
2023-07-20 15:18 ` patch 'crypto/ipsec_mb: fix enqueue counter for SNOW3G' " Kevin Traynor
2023-07-20 15:18 ` patch 'crypto/ipsec_mb: optimize allocation in session' " Kevin Traynor
2023-07-20 15:18 ` patch 'vhost: fix invalid call FD handling' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/virtio: propagate interrupt configuration error values' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/virtio: fix initialization to return negative errno' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/mlx5: enhance error log for tunnel offloading' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/mlx5: fix duplicated tag index matching in SWS' " Kevin Traynor
2023-07-20 15:18 ` patch 'common/cnxk: fix IPsec IPv6 tunnel address byte swap' " Kevin Traynor
2023-07-20 15:18 ` patch 'common/cnxk: fix inline device VF identification' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/qede: fix RSS indirection table initialization' " Kevin Traynor
2023-07-20 15:18 ` patch 'doc: fix typo in cnxk platform guide' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/i40e: fix Rx data buffer size' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ice: " Kevin Traynor
2023-07-20 15:18 ` patch 'net/iavf: " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ice: fix statistics' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ice: fix DCF RSS initialization' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/iavf: release large VF when closing device' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ice: fix DCF control thread crash' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ice/base: remove unreachable code' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ice: adjust timestamp mbuf register' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ice: fix timestamp enabling' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ice: initialize parser for double VLAN' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ice: fix outer UDP checksum offload' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/virtio-user: fix leak when initialisation fails' " Kevin Traynor
2023-07-20 15:18 ` patch 'doc: fix typo in graph guide' " Kevin Traynor
2023-07-20 15:18 ` patch 'doc: remove warning with Doxygen 1.9.7' " Kevin Traynor
2023-07-20 15:18 ` patch 'examples/l2fwd-cat: fix external build' " Kevin Traynor
2023-07-20 15:18 ` patch 'test: add graph tests' " Kevin Traynor
2023-07-20 15:18 ` patch 'mbuf: fix Doxygen comment of distributor metadata' " Kevin Traynor
2023-07-20 15:18 ` patch 'ci: fix libabigail cache in GHA' " Kevin Traynor
2023-07-20 15:18 ` patch 'crypto/openssl: skip workaround at compilation time' " Kevin Traynor
2023-07-20 15:18 ` patch 'ethdev: update documentation for API to set FEC' " Kevin Traynor
2023-07-20 15:18 ` patch 'ethdev: check that at least one FEC mode is specified' " Kevin Traynor
2023-07-20 15:18 ` patch 'ethdev: update documentation for API to get FEC' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/bonding: fix startup when NUMA is not supported' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/bonding: fix destroy dedicated queues flow' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/txgbe/base: fix Tx with fiber hotplug' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/txgbe: fix interrupt enable mask' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/txgbe: fix to set autoneg for 1G speed' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/txgbe: fix extended statistics' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ngbe: " Kevin Traynor
2023-07-20 15:18 ` patch 'app/testpmd: fix primary process not polling all queues' " Kevin Traynor
2023-07-24  1:58   ` haijie
2023-07-24 13:22     ` Kevin Traynor
2023-07-20 15:18 ` patch 'net/nfp: fix address always related with PF ID 0' " Kevin Traynor
2023-07-20 15:18 ` patch 'common/sfc_efx/base: fix Rx queue without RSS hash prefix' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/iavf: fix VLAN offload with AVX512' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ice: fix tunnel packet Tx descriptor' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ixgbe: add proper memory barriers in Rx' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/iavf: fix abnormal disable HW interrupt' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/i40e: fix tunnel packet Tx descriptor' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/e1000: fix queue number initialization' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/ice: fix protocol agnostic offloading with big packets' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/mlx5: fix risk in NEON Rx descriptor read' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/mlx5: fix device removal event handling' " Kevin Traynor
2023-07-20 15:18 ` patch 'common/mlx5: adjust fork call with new kernel API' " Kevin Traynor
2023-07-20 15:18 ` patch 'net/cnxk: flush SQ before configuring MTU' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/cnxk: fix cookies check with security offload' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/cnxk: fix flow queue index validation' " Kevin Traynor
2023-07-20 15:19 ` patch 'ipc: fix file descriptor leakage with unhandled messages' " Kevin Traynor
2023-07-20 15:19 ` patch 'fib: fix adding default route' " Kevin Traynor
2023-07-20 15:19 ` patch 'mem: fix memsegs exhausted message' " Kevin Traynor
2023-07-20 15:19 ` patch 'hash: fix reading unaligned bits in Toeplitz hash' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/netvsc: fix sizeof calculation' " Kevin Traynor
2023-07-20 15:19 ` patch 'app/testpmd: fix checksum engine with GTP on 32-bit' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/hns3: delete duplicate macro definition' " Kevin Traynor
2023-07-20 15:19 ` patch 'doc: fix kernel patch link in hns3 guide' " Kevin Traynor
2023-07-20 15:19 ` patch 'doc: fix syntax " Kevin Traynor
2023-07-20 15:19 ` patch 'doc: fix number of leading spaces " Kevin Traynor
2023-07-20 15:19 ` patch 'app/testpmd: revert primary process polling all queues fix' " Kevin Traynor
2023-07-25  8:53   ` Kevin Traynor
2023-07-20 15:19 ` patch 'net/hns3: fix non-zero weight for disabled TC' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/hns3: fix index to look up table in NEON Rx' " Kevin Traynor
2023-07-20 15:19 ` patch 'ethdev: fix potential leak in PCI probing helper' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/mlx5: fix flow dump for modify field' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/mlx5: fix flow workspace destruction' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/mlx5: forbid MPRQ restart' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/ice: fix VLAN mode parser' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/iavf: fix VLAN insertion in vector path' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/ice: fix 32-bit build' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/iavf: fix tunnel TSO path selection' " Kevin Traynor
2023-07-20 15:19 ` patch 'net/ice: fix RSS hash key generation' " Kevin Traynor
2023-07-20 15:19 ` patch 'baseband/fpga_5gnr_fec: fix possible division by zero' " Kevin Traynor
2023-07-20 15:19 ` patch 'baseband/fpga_5gnr_fec: fix starting unconfigured queue' " Kevin Traynor
2023-07-20 15:19 ` patch 'common/qat: detach crypto from compress build' " Kevin Traynor
2023-07-20 15:19 ` patch 'test/crypto: fix PDCP-SDAP test vectors' " Kevin Traynor
2023-07-20 15:19 ` patch 'examples/fips_validation: fix digest length in AES-GCM' " Kevin Traynor
2023-07-20 15:19 ` patch 'app/crypto-perf: fix socket ID default value' " Kevin Traynor
2023-07-20 15:19 ` patch 'examples/ipsec-secgw: fix TAP default MAC address' " Kevin Traynor
2023-07-20 15:19 ` patch 'ipsec: fix NAT-T header length' " Kevin Traynor
2023-07-20 15:19 ` patch 'kni: fix build with Linux 6.5' " Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230720151942.262154-4-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=konstantin.v.ananyev@yandex.ru \
    --cc=stable@dpdk.org \
    --cc=wangyunjian@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).