[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y/VSnV8FFRWU4TzC@salvia>
Date: Wed, 22 Feb 2023 00:24:13 +0100
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Xin Long <lucien.xin@...il.com>
Cc: netfilter-devel@...r.kernel.org,
network dev <netdev@...r.kernel.org>,
Jozsef Kadlecsik <kadlec@...filter.org>,
Florian Westphal <fw@...len.de>, davem@...emloft.net,
kuba@...nel.org, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH nf] netfilter: use skb len to match in length_mt6
On Fri, Feb 17, 2023 at 06:22:57PM -0500, Xin Long wrote:
> For IPv6 Jumbo packets, the ipv6_hdr(skb)->payload_len is always 0,
> and its real payload_len ( > 65535) is saved in hbh exthdr. With 0
> length for the jumbo packets, it may mismatch.
>
> To fix this, we can just use skb->len instead of parsing exthdrs, as
> the hbh exthdr parsing has been done before coming to length_mt6 in
> ip6_rcv_core() and br_validate_ipv6() and also the packet has been
> trimmed according to the correct IPv6 (ext)hdr length there, and skb
> len is trustable in length_mt6().
>
> Note that this patch is especially needed after the IPv6 BIG TCP was
> supported in kernel, which is using IPv6 Jumbo packets. Besides, to
> match the packets greater than 65535 more properly, a v1 revision of
> xt_length may be needed to extend "min, max" to u32 in the future,
> and for now the IPv6 Jumbo packets can be matched by:
>
> # ip6tables -m length ! --length 0:65535
Applied, thanks
Powered by blists - more mailing lists