patch 'net/netvsc: fix event buffer leak on realloc failure' has been queued to stable release 24.11.9
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Thu Nov 5 17:43:17 CET 2026
Hi,
FYI, your patch has been queued to stable release 24.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 11/07/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/bluca/dpdk-stable
This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/0f4131a2e73b06cc10c8a471e5a652ad52b2f808
Thanks.
Luca Boccassi
---
>From 0f4131a2e73b06cc10c8a471e5a652ad52b2f808 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 | 4 +++-
drivers/net/netvsc/hn_rxtx.c | 18 ++++++++++--------
2 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/.mailmap b/.mailmap
index 6555bd6f0ca..ace7dc94c7a 100644
--- a/.mailmap
+++ b/.mailmap
@@ -252,7 +252,9 @@ Chao Zhu <chaozhu at linux.vnet.ibm.com> <bjzhuc at cn.ibm.com>
Charles Brett <cfb at hpe.com>
Charles Myers <charles.myers at spirent.com>
Charles Stoll <charles.stoll at intel.com>
-Chas Williams <3chas3 at gmail.com> <chas3 at att.com> <ciwillia at brocade.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>
Chengchang Tang <tangchengchang at huawei.com> <tangchengchang at hisilicon.com>
Chengfeng Ye <cyeaa at connect.ust.hk>
diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c
index 87d107bb5ee..7fcfbcec41d 100644
--- a/drivers/net/netvsc/hn_rxtx.c
+++ b/drivers/net/netvsc/hn_rxtx.c
@@ -1128,17 +1128,19 @@ 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;
}
if (unlikely(ret <= 0)) {
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-11-05 16:42:49.136425616 +0000
+++ 0110-net-netvsc-fix-event-buffer-leak-on-realloc-failure.patch 2026-11-05 16:42:45.065065089 +0000
@@ -1 +1 @@
-From 9e712ae749b26d8dd24aa72a2c9dae86cc02ed8b Mon Sep 17 00:00:00 2001
+From 0f4131a2e73b06cc10c8a471e5a652ad52b2f808 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 9e712ae749b26d8dd24aa72a2c9dae86cc02ed8b ]
+
@@ -11 +12,0 @@
-Cc: stable at dpdk.org
@@ -15 +16 @@
- .mailmap | 1 +
+ .mailmap | 4 +++-
@@ -17 +18 @@
- 2 files changed, 11 insertions(+), 8 deletions(-)
+ 2 files changed, 13 insertions(+), 9 deletions(-)
@@ -20 +21 @@
-index 8c3f06e6bb..754dd9e760 100644
+index 6555bd6f0ca..ace7dc94c7a 100644
@@ -23 +24,3 @@
-@@ -270,6 +270,7 @@ Charles Myers <charles.myers at spirent.com>
+@@ -252,7 +252,9 @@ Chao Zhu <chaozhu at linux.vnet.ibm.com> <bjzhuc at cn.ibm.com>
+ Charles Brett <cfb at hpe.com>
+ Charles Myers <charles.myers at spirent.com>
@@ -25,2 +28,3 @@
- Chas Williams <3chas3 at gmail.com> <chas3 at att.com>
- Chas Williams <3chas3 at gmail.com> <ciwillia at brocade.com>
+-Chas Williams <3chas3 at gmail.com> <chas3 at att.com> <ciwillia at brocade.com>
++Chas Williams <3chas3 at gmail.com> <chas3 at att.com>
++Chas Williams <3chas3 at gmail.com> <ciwillia at brocade.com>
@@ -29,2 +33,2 @@
- Cheng Jiang <honest.jiang at foxmail.com> <cheng1.jiang at intel.com>
- Cheng Liu <liucheng11 at huawei.com>
+ Chengchang Tang <tangchengchang at huawei.com> <tangchengchang at hisilicon.com>
+ Chengfeng Ye <cyeaa at connect.ust.hk>
@@ -32 +36 @@
-index 9a04861005..7987b70ce5 100644
+index 87d107bb5ee..7fcfbcec41d 100644
@@ -35 +39 @@
-@@ -1131,17 +1131,19 @@ retry:
+@@ -1128,17 +1128,19 @@ retry:
More information about the stable
mailing list