summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Hughes <tom@compton.nu>2024-08-06 13:40:52 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2024-08-14 21:16:12 +0200
commit3cd740b985963f874a1a094f1969e998b9d05554 (patch)
tree2d206ca2becf1c254ad3af294fa39532463f213d
parenttcp: Update window clamping condition (diff)
downloadlinux-3cd740b985963f874a1a094f1969e998b9d05554.tar.xz
linux-3cd740b985963f874a1a094f1969e998b9d05554.zip
netfilter: allow ipv6 fragments to arrive on different devices
Commit 264640fc2c5f4 ("ipv6: distinguish frag queues by device for multicast and link-local packets") modified the ipv6 fragment reassembly logic to distinguish frag queues by device for multicast and link-local packets but in fact only the main reassembly code limits the use of the device to those address types and the netfilter reassembly code uses the device for all packets. This means that if fragments of a packet arrive on different interfaces then netfilter will fail to reassemble them and the fragments will be expired without going any further through the filters. Fixes: 648700f76b03 ("inet: frags: use rhashtables for reassembly units") Signed-off-by: Tom Hughes <tom@compton.nu> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index 6f0844c9315d..4120e67a8ce6 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -154,6 +154,10 @@ static struct frag_queue *fq_find(struct net *net, __be32 id, u32 user,
};
struct inet_frag_queue *q;
+ if (!(ipv6_addr_type(&hdr->daddr) & (IPV6_ADDR_MULTICAST |
+ IPV6_ADDR_LINKLOCAL)))
+ key.iif = 0;
+
q = inet_frag_find(nf_frag->fqdir, &key);
if (!q)
return NULL;