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

Kevin Traynor ktraynor at redhat.com
Fri Jul 18 21:30:27 CEST 2025


Hi,

FYI, your patch has been queued to stable release 24.11.3

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/23/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/kevintraynor/dpdk-stable

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

Thanks.

Kevin

---
>From f0b892c99960cbc2069c60fcb9e23f206e2bd51e 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 16485b27cb..66c16ba227 100644
--- a/lib/pcapng/rte_pcapng.c
+++ b/lib/pcapng/rte_pcapng.c
@@ -717,5 +717,7 @@ void
 rte_pcapng_close(rte_pcapng_t *self)
 {
-	close(self->outfd);
-	free(self);
+	if (self) {
+		close(self->outfd);
+		free(self);
+	}
 }
-- 
2.50.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-07-18 20:29:14.234486737 +0100
+++ 0093-pcapng-fix-null-dereference-in-close.patch	2025-07-18 20:29:10.999943414 +0100
@@ -1 +1 @@
-From b24a6349ae1d56b947186c9545349fca1ca87614 Mon Sep 17 00:00:00 2001
+From f0b892c99960cbc2069c60fcb9e23f206e2bd51e Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit b24a6349ae1d56b947186c9545349fca1ca87614 ]
+
@@ -22 +24 @@
-index cacbefdc50..2a07b4c1f5 100644
+index 16485b27cb..66c16ba227 100644
@@ -25 +27 @@
-@@ -725,5 +725,7 @@ void
+@@ -717,5 +717,7 @@ void



More information about the stable mailing list