patch 'net/netvsc: fix event buffer leak on realloc failure' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:04:43 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.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 12/08/26. 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/ee366b5b20f68bc3f9b0b47127ca541c5e6b9bb9

Thanks.

Kevin

---
>From ee366b5b20f68bc3f9b0b47127ca541c5e6b9bb9 Mon Sep 17 00:00:00 2001
From: Chen Zhao <ch3nzhao at gmail.com>
Date: Thu, 29 Oct 2026 16:54:52 +0000
Subject: [PATCH] net/netvsc: fix event buffer leak on realloc failure

[ upstream commit 9e712ae749b26d8dd24aa72a2c9dae86cc02ed8b ]

rte_realloc() failure overwrites event_buf and leaks the old allocation.
Use a temporary pointer and update event_buf and event_sz only on success,
preserving the existing buffer and size on failure.

Fixes: 1f2766b7ee02 ("net/netvsc: resize event buffer as needed")

Signed-off-by: Chen Zhao <ch3nzhao at gmail.com>
---
 .mailmap                     |  1 +
 drivers/net/netvsc/hn_rxtx.c | 18 ++++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/.mailmap b/.mailmap
index 4915d560da..d5ddc450e4 100644
--- a/.mailmap
+++ b/.mailmap
@@ -266,4 +266,5 @@ Charles Stoll <charles.stoll at intel.com>
 Chas Williams <3chas3 at gmail.com> <chas3 at att.com>
 Chas Williams <3chas3 at gmail.com> <ciwillia at brocade.com>
+Chen Zhao <ch3nzhao at gmail.com>
 Chenbo Xia <chenbox at nvidia.com> <chenbo.xia at intel.com>
 Cheng Jiang <honest.jiang at foxmail.com> <cheng1.jiang at intel.com>
diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index 0ef953c6ab..d2b522774f 100644
--- a/drivers/net/netvsc/hn_rxtx.c
+++ b/drivers/net/netvsc/hn_rxtx.c
@@ -1130,15 +1130,17 @@ retry:
 		if (unlikely(ret == -ENOBUFS)) {
 			/* event buffer not large enough to read ring */
+			uint32_t new_sz = len + len / 4;
+			void *new_buf;
 
 			PMD_DRV_LOG(DEBUG,
 				    "event buffer expansion (need %u)", len);
-			rxq->event_sz = len + len / 4;
-			rxq->event_buf = rte_realloc(rxq->event_buf, rxq->event_sz,
-						     RTE_CACHE_LINE_SIZE);
-			if (rxq->event_buf)
-				goto retry;
-			/* out of memory, no more events now */
-			rxq->event_sz = 0;
-			break;
+			new_buf = rte_realloc(rxq->event_buf, new_sz,
+					      RTE_CACHE_LINE_SIZE);
+			if (new_buf == NULL)
+				break;	/* out of memory, no more events now */
+
+			rxq->event_buf = new_buf;
+			rxq->event_sz = new_sz;
+			goto retry;
 		}
 
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:49.301135305 +0000
+++ 0357-net-netvsc-fix-event-buffer-leak-on-realloc-failure.patch	2026-12-03 12:52:39.276149647 +0000
@@ -1 +1 @@
-From 9e712ae749b26d8dd24aa72a2c9dae86cc02ed8b Mon Sep 17 00:00:00 2001
+From ee366b5b20f68bc3f9b0b47127ca541c5e6b9bb9 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9e712ae749b26d8dd24aa72a2c9dae86cc02ed8b ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -20 +21 @@
-index 8c3f06e6bb..754dd9e760 100644
+index 4915d560da..d5ddc450e4 100644
@@ -23 +24 @@
-@@ -271,4 +271,5 @@ Charles Stoll <charles.stoll at intel.com>
+@@ -266,4 +266,5 @@ Charles Stoll <charles.stoll at intel.com>
@@ -30 +31 @@
-index 9a04861005..7987b70ce5 100644
+index 0ef953c6ab..d2b522774f 100644
@@ -33 +34 @@
-@@ -1132,15 +1132,17 @@ retry:
+@@ -1130,15 +1130,17 @@ retry:



More information about the stable mailing list