patch 'pcapng: fix null dereference in close' has been queued to stable release 22.11.9

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Jun 12 23:07:24 CEST 2025


Hi,

FYI, your patch has been queued to stable release 22.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/14/25. 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/cc22066925ac875b42db4ccf0f740337db0134e8

Thanks.

Luca Boccassi

---
>From cc22066925ac875b42db4ccf0f740337db0134e8 Mon Sep 17 00:00:00 2001
From: Ariel Otilibili <ariel.otilibili at 6wind.com>
Date: Mon, 24 Feb 2025 17:40:31 +0100
Subject: [PATCH] pcapng: fix null dereference in close

[ upstream commit b24a6349ae1d56b947186c9545349fca1ca87614 ]

rte_pcapng_close() might dereference a null pointer; as example,
PVS-Studio gives its usage in test_pcapng.c: indeed, that call to
rte_pcapng_close() might receive a null pointer.

Link: https://pvs-studio.com/en/docs/warnings/v522/
Link: https://github.com/DPDK/dpdk/blob/e5176f23ae8b31437c3e5eb875c81f95bf3a9942/app/test/test_pcapng.c#L438

Fixes: 8d23ce8f5ee9 ("pcapng: add new library for writing pcapng files")

Suggested-by: Stephen Hemminger <stephen at networkplumber.org>
Signed-off-by: Ariel Otilibili <ariel.otilibili at 6wind.com>
---
 lib/pcapng/rte_pcapng.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c
index 3f5e08379a..d82f992ffd 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -664,6 +664,8 @@ fail:
 void
 rte_pcapng_close(rte_pcapng_t *self)
 {
-	close(self->outfd);
-	free(self);
+	if (self) {
+		close(self->outfd);
+		free(self);
+	}
 }
-- 
2.47.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-06-12 22:06:26.286521742 +0100
+++ 0067-pcapng-fix-null-dereference-in-close.patch	2025-06-12 22:06:23.894045145 +0100
@@ -1 +1 @@
-From b24a6349ae1d56b947186c9545349fca1ca87614 Mon Sep 17 00:00:00 2001
+From cc22066925ac875b42db4ccf0f740337db0134e8 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b24a6349ae1d56b947186c9545349fca1ca87614 ]
+
@@ -22 +24 @@
-index cacbefdc50..2a07b4c1f5 100644
+index 3f5e08379a..d82f992ffd 100644
@@ -25 +27 @@
-@@ -724,6 +724,8 @@ RTE_EXPORT_SYMBOL(rte_pcapng_close)
+@@ -664,6 +664,8 @@ fail:


More information about the stable mailing list