patch 'ip_frag: drop IPv6 fragments with per-fragment headers' has been queued to stable release 24.11.7
luca.boccassi at gmail.com
luca.boccassi at gmail.com
Mon Jul 6 12:20:58 CEST 2026
Hi,
FYI, your patch has been queued to stable release 24.11.7
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/05/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/be9fbcb8f0f13be7b2a58ea5394263273e1c8736
Thanks.
Luca Boccassi
---
>From be9fbcb8f0f13be7b2a58ea5394263273e1c8736 Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Wed, 1 Jul 2026 09:20:29 -0700
Subject: [PATCH] ip_frag: drop IPv6 fragments with per-fragment headers
[ upstream commit 3d9ffda1a711a7b5743cb4f472787c2c4d8a8257 ]
IPv6 reassembly assumes the fragment header directly follows the IPv6
header. ipv6_frag_reassemble() patches the next-header field and removes
the fragment header at a fixed offset, so a fragment with per-fragment
extension headers before the fragment header reassembles to a corrupt
datagram.
Drop the fragment when its fragment header does not directly follow the
IPv6 header. Headers after the fragment header are payload and are
unaffected.
RFC 8200 permits discarding packets with extension headers out of the
recommended order, and RFC 9099 recommends dropping non-conforming
fragmented packets.
Fixes: 4f1a8f633862 ("ip_frag: add IPv6 reassembly")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Konstantin Ananyev <konstantin.ananyev at huawei.com>
---
lib/ip_frag/rte_ipv6_reassembly.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/lib/ip_frag/rte_ipv6_reassembly.c b/lib/ip_frag/rte_ipv6_reassembly.c
index 9471ce5333..4197fbfd85 100644
--- a/lib/ip_frag/rte_ipv6_reassembly.c
+++ b/lib/ip_frag/rte_ipv6_reassembly.c
@@ -178,6 +178,28 @@ rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
return NULL;
}
+ /*
+ * Only a fragment header directly following the IPv6 header is supported.
+ * Per-fragment (unfragmentable) extension headers placed
+ * before the fragment header are not handled: ipv6_frag_reassemble()
+ * patches the IPv6 header's next-header field and removes the fragment
+ * header assuming it sits immediately after the IPv6 header, so such a
+ * fragment would be reassembled into a corrupt datagram. Drop it.
+ *
+ * Extension headers after the fragment header (destination options,
+ * AH, ESP, upper-layer) are part of the fragmentable payload and are
+ * reassembled as opaque bytes, so they are not affected. The test uses
+ * the fragment header's position rather than l3_len so that callers
+ * which include later headers in l3_len are not rejected.
+ */
+ if ((uintptr_t)frag_hdr != (uintptr_t)(ip_hdr + 1)) {
+ IP_FRAG_LOG(DEBUG,
+ "%s:%d: drop fragment with header before frag header, offset %zu\n",
+ __func__, __LINE__, (uintptr_t)frag_hdr - (uintptr_t)ip_hdr);
+ IP_FRAG_MBUF2DR(dr, mb);
+ return NULL;
+ }
+
if (unlikely(trim > 0))
rte_pktmbuf_trim(mb, trim);
--
2.47.3
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-07-03 12:55:49.194081942 +0100
+++ 0066-ip_frag-drop-IPv6-fragments-with-per-fragment-header.patch 2026-07-03 12:55:46.714575135 +0100
@@ -1 +1 @@
-From 3d9ffda1a711a7b5743cb4f472787c2c4d8a8257 Mon Sep 17 00:00:00 2001
+From be9fbcb8f0f13be7b2a58ea5394263273e1c8736 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 3d9ffda1a711a7b5743cb4f472787c2c4d8a8257 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -26,16 +27,3 @@
- doc/guides/rel_notes/release_26_07.rst | 1 +
- lib/ip_frag/rte_ipv6_reassembly.c | 22 ++++++++++++++++++++++
- 2 files changed, 23 insertions(+)
-
-diff --git a/doc/guides/rel_notes/release_26_07.rst b/doc/guides/rel_notes/release_26_07.rst
-index 42fcd9af1b..bb3ad50dd6 100644
---- a/doc/guides/rel_notes/release_26_07.rst
-+++ b/doc/guides/rel_notes/release_26_07.rst
-@@ -305,6 +305,7 @@ API Changes
-
- - Duplicate fragments are tolerated instead of failing reassembly.
- - Overlapping fragments are rejected on arrival rather than during reassembly.
-+ - For IPv6, fragments with per-fragment extension headers are rejected.
-
- Overlap is now detected on arrival, which adds a scan of the
- already received fragments per fragment and may affect throughput.
+ lib/ip_frag/rte_ipv6_reassembly.c | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
@@ -43 +31 @@
-index 0e809a01e5..b6f623d53b 100644
+index 9471ce5333..4197fbfd85 100644
@@ -46 +34 @@
-@@ -180,6 +180,28 @@ rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
+@@ -178,6 +178,28 @@ rte_ipv6_frag_reassemble_packet(struct rte_ip_frag_tbl *tbl,
More information about the stable
mailing list