From: Fernando Fernandez Mancera <fmancera@suse.de>
To: netdev@vger.kernel.org
Cc: horms@kernel.org, pabeni@redhat.com, kuba@kernel.org,
edumazet@google.com, dsahern@kernel.org, davem@davemloft.net,
Fernando Fernandez Mancera <fmancera@suse.de>
Subject: [PATCH net-next] ipv6: discard fragment queue if middle fragment is not 8 bytes aligned
Date: Mon, 23 Feb 2026 16:19:18 +0100 [thread overview]
Message-ID: <20260223151918.31965-1-fmancera@suse.de> (raw)
Currently the kernel IPv6 implementation is not dicarding the fragment
queue upon receiving a IPv6 fragment that is not 8 bytes aligned. It
relies on queue expiration to free the queue.
While RFC 8200 section 4.5 does not explicitly mention that the rest of
fragments must be discarded, it does not make sense to keep them. The
parameter problem message is sent regardless that. In addition, if the
sender is able to re-compose the datagram so it is 8 bytes aligned it
would qualify as a new whole datagram not fitting into the same fragment
queue.
The sooner we can free resources during reassembly, the better.
Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
---
net/ipv6/reassembly.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index 25ec8001898d..8b0bc0ba56f4 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -163,6 +163,9 @@ static int ip6_frag_queue(struct net *net,
* this case. -DaveM
*/
*prob_offset = offsetof(struct ipv6hdr, payload_len);
+ inet_frag_kill(&fq->q, refs);
+ __IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
+ IPSTATS_MIB_REASMFAILS);
return -1;
}
if (end > fq->q.len) {
--
2.53.0
next reply other threads:[~2026-02-23 15:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-23 15:19 Fernando Fernandez Mancera [this message]
2026-02-23 15:42 ` [PATCH net-next] ipv6: discard fragment queue if middle fragment is not 8 bytes aligned Eric Dumazet
2026-02-23 15:50 ` Fernando Fernandez Mancera
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260223151918.31965-1-fmancera@suse.de \
--to=fmancera@suse.de \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox