lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 21 Mar 2024 21:52:27 +0100
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Linus Lüssing <linus.luessing@...3.blue>
Cc: netfilter-devel@...r.kernel.org, coreteam@...filter.org,
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
	Jozsef Kadlecsik <kadlec@...filter.org>,
	Florian Westphal <fw@...len.de>,
	"David S . Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Dietmar Maurer <dietmar@...xmox.com>,
	Thomas Lamprecht <t.lamprecht@...xmox.com>,
	Wolfgang Bumiller <w.bumiller@...xmox.com>,
	Alexandre Derumier <aderumier@...so.com>
Subject: Re: [PATCH net] netfilter: conntrack: fix ct-state for ICMPv6
 Multicast Router Discovery

On Wed, Mar 06, 2024 at 03:18:04PM +0100, Linus Lüssing wrote:
> 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.

There is also RFC4890 which specifies that also acts as multicast
routers need to process these message on their interfaces.

> 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.

An explicit rule will be still needed to accept this traffic, assuming
default policy to drop. I think that the issue is likely that this
"drop invalid rules" is the at the very beginning of the ruleset.

Anyway, turning this from invalid to untracked seems sensible to me.
Users will still have to explicitly allow for this in their ruleset
assuming default policy to drop.

I am going to include your Fixes: tag and pass up this patch upstream.

Thanks.

> 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@...3.blue>
> ---
>  include/uapi/linux/icmpv6.h               | 1 +
>  net/netfilter/nf_conntrack_proto_icmpv6.c | 4 +++-
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/icmpv6.h b/include/uapi/linux/icmpv6.h
> index ecaece3af38d..4eaab89e2856 100644
> --- a/include/uapi/linux/icmpv6.h
> +++ b/include/uapi/linux/icmpv6.h
> @@ -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
>  
> diff --git a/net/netfilter/nf_conntrack_proto_icmpv6.c b/net/netfilter/nf_conntrack_proto_icmpv6.c
> index 1020d67600a9..327b8059025d 100644
> --- a/net/netfilter/nf_conntrack_proto_icmpv6.c
> +++ b/net/netfilter/nf_conntrack_proto_icmpv6.c
> @@ -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,
> -- 
> 2.43.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ