diff mbox series

[net,1/8] netfilter: allow ipv6 fragments to arrive on different devices

Message ID 20240814222042.150590-2-pablo@netfilter.org
State Awaiting Upstream, archived
Headers show
Series [net,1/8] netfilter: allow ipv6 fragments to arrive on different devices | expand

Commit Message

Pablo Neira Ayuso Aug. 14, 2024, 10:20 p.m. UTC
From: Tom Hughes <tom@compton.nu>

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>
---
 net/ipv6/netfilter/nf_conntrack_reasm.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org Aug. 15, 2024, 11:30 a.m. UTC | #1
Hello:

This series was applied to netdev/net.git (main)
by Pablo Neira Ayuso <pablo@netfilter.org>:

On Thu, 15 Aug 2024 00:20:35 +0200 you wrote:
> From: Tom Hughes <tom@compton.nu>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - [net,1/8] netfilter: allow ipv6 fragments to arrive on different devices
    https://git.kernel.org/netdev/net/c/3cd740b98596
  - [net,2/8] netfilter: nfnetlink: Initialise extack before use in ACKs
    https://git.kernel.org/netdev/net/c/d1a7b382a9d3
  - [net,3/8] netfilter: flowtable: initialise extack before use
    https://git.kernel.org/netdev/net/c/e9767137308d
  - [net,4/8] netfilter: nf_queue: drop packets with cloned unconfirmed conntracks
    https://git.kernel.org/netdev/net/c/7d8dc1c7be8d
  - [net,5/8] selftests: netfilter: add test for br_netfilter+conntrack+queue combination
    https://git.kernel.org/netdev/net/c/ea2306f0330c
  - [net,6/8] netfilter: nf_tables: Audit log dump reset after the fact
    https://git.kernel.org/netdev/net/c/e0b6648b0446
  - [net,7/8] netfilter: nf_tables: Introduce nf_tables_getobj_single
    https://git.kernel.org/netdev/net/c/69fc3e9e90f1
  - [net,8/8] netfilter: nf_tables: Add locking for NFT_MSG_GETOBJ_RESET requests
    https://git.kernel.org/netdev/net/c/bd662c4218f9

You are awesome, thank you!
diff mbox series

Patch

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;