netfilter: conntrack: fix ct-state for ICMPv6 Multicast Router Discovery
authorLinus Lüssing <linus.luessing@c0d3.blue>
Wed, 6 Mar 2024 14:18:04 +0000 (15:18 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Mon, 6 May 2024 09:13:56 +0000 (11:13 +0200)
So far Multicast Router Advertisements and Multicast Router
Solicitations from the Multicast Router Discovery protocol (RFC4286)
would be marked as INVALID for IPv6, even if they are in fact intact
and adhering to RFC4286.

This broke MRA reception and by that multicast reception on
IPv6 multicast routers in a Proxmox managed setup, where Proxmox
would install a rule like "-m conntrack --ctstate INVALID -j DROP"
at the top of the FORWARD chain with br-nf-call-ip6tables enabled
by default.

Similar to as it's done for MLDv1, MLDv2 and IPv6 Neighbor Discovery
already, fix this issue by excluding MRD from connection tracking
handling as MRD always uses predefined multicast destinations
for its messages, too. This changes the ct-state for ICMPv6 MRD messages
from INVALID to UNTRACKED.

This issue was found and fixed with the help of the mrdisc tool
(https://github.com/troglobit/mrdisc).

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/uapi/linux/icmpv6.h
net/netfilter/nf_conntrack_proto_icmpv6.c

index ecaece3af38df33638083b163eead9a9f6ecb270..4eaab89e2856d3eedc1ccb4b50b8806f19527238 100644 (file)
@@ -112,6 +112,7 @@ struct icmp6hdr {
 #define ICMPV6_MOBILE_PREFIX_ADV       147
 
 #define ICMPV6_MRDISC_ADV              151
+#define ICMPV6_MRDISC_SOL              152
 
 #define ICMPV6_MSG_MAX          255
 
index 1020d67600a9593b428502dbeff8a60431b1a817..327b8059025daded28ff53b6f5e333a182341c5e 100644 (file)
@@ -62,7 +62,9 @@ static const u_int8_t noct_valid_new[] = {
        [NDISC_ROUTER_ADVERTISEMENT - 130] = 1,
        [NDISC_NEIGHBOUR_SOLICITATION - 130] = 1,
        [NDISC_NEIGHBOUR_ADVERTISEMENT - 130] = 1,
-       [ICMPV6_MLD2_REPORT - 130] = 1
+       [ICMPV6_MLD2_REPORT - 130] = 1,
+       [ICMPV6_MRDISC_ADV - 130] = 1,
+       [ICMPV6_MRDISC_SOL - 130] = 1
 };
 
 bool nf_conntrack_invert_icmpv6_tuple(struct nf_conntrack_tuple *tuple,