* [PATCH v2 nf] netfilter: ipv6: stop the conntrack fragment search at AH
@ 2026-11-21 5:53 Ryosuke Iwahashi
2026-11-21 6:00 ` Florian Westphal
0 siblings, 1 reply; 2+ messages in thread
From: Ryosuke Iwahashi @ 2026-11-21 5:53 UTC (permalink / raw)
To: Pablo Neira Ayuso, Florian Westphal; +Cc: Phil Sutter, netfilter-devel
find_prev_fhdr() looks beyond an IPv6 Authentication Header (AH) for a
Fragment header. Reassembly there can change data covered by AH before
IPv6 input processes AH.
Stop the search at AH. Conntrack still reassembles fragments when the
Fragment header precedes AH.
Fixes: 6aafeef03b9d ("netfilter: push reasm skb through instead of original frag skbs")
Signed-off-by: Ryosuke Iwahashi <ryosuke@ikotaslabs.com>
---
v2: Resend without line wrapping.
net/ipv6/netfilter/nf_conntrack_reasm.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index be72c4346f8b..9d49e3f8236b 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -407,9 +407,9 @@ find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff)
struct ipv6_opt_hdr hdr;
int hdrlen;
- if (!ipv6_ext_hdr(nexthdr)) {
+ /* Leave headers beyond AH for the authenticated input path. */
+ if (!ipv6_ext_hdr(nexthdr) || nexthdr == NEXTHDR_AUTH)
return -1;
- }
if (nexthdr == NEXTHDR_NONE) {
pr_debug("next header is none\n");
return -1;
@@ -420,10 +420,7 @@ find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff)
}
if (skb_copy_bits(skb, start, &hdr, sizeof(hdr)))
return -1;
- if (nexthdr == NEXTHDR_AUTH)
- hdrlen = ipv6_authlen(&hdr);
- else
- hdrlen = ipv6_optlen(&hdr);
+ hdrlen = ipv6_optlen(&hdr);
prevhdr = nexthdr;
prev_nhoff = start;
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-21 6:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-21 5:53 [PATCH v2 nf] netfilter: ipv6: stop the conntrack fragment search at AH Ryosuke Iwahashi
2026-11-21 6:00 ` Florian Westphal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.