From: Fernando Fernandez Mancera <fmancera@suse.de>
To: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
Cc: davem@davemloft.net, edumazet@google.com, fengxw06@126.com,
fw@strlen.de, horms@kernel.org, kuba@kernel.org,
netfilter-devel@vger.kernel.org, pabeni@redhat.com,
pablo@netfilter.org, phil@nwl.cc, qli01@tsinghua.edu.cn,
stable@vger.kernel.org, xuke@tsinghua.edu.cn,
yangyx22@mails.tsinghua.edu.cn
Subject: Re: [PATCH v2 nft] netfilter: nft_inner: Fix IPv6 inner_thoff desync
Date: Mon, 11 May 2026 18:27:19 +0200 [thread overview]
Message-ID: <5a17cb3e-72c6-404f-8bbf-cde2c9047b0f@suse.de> (raw)
In-Reply-To: <20260511133744.6716-1-zhaoyz24@mails.tsinghua.edu.cn>
On 5/11/26 3:37 PM, Yizhou Zhao wrote:
> Thank you for your suggestions. Here's the v2 version of our patch.
>
> In nft_inner_parse_l2l3(), when processing inner IPv6 packets,
> ipv6_find_hdr() correctly computes the transport header offset
> traversing all extension headers, but the result is immediately
> overwritten with nhoff + sizeof(_ip6h) (40 bytes), which only
> accounts for the IPv6 base header. This creates a desync between
> inner_thoff (wrong — points to extension header start) and l4proto
> (correct — e.g., IPPROTO_TCP), enabling transport header forgery
> and potential firewall bypass. This issue affects stable versions
> from Linux 6.2.
>
> For comparison, the normal (non-inner) IPv6 path correctly
> preserves ipv6_find_hdr()'s result. Removing the incorrect overwrite
> ensures that ipv6_find_hdr()'s calculated transport header offset is
> preserved, thereby fixing the desynchronization.
>
> Fixes: 3a07327d10a0 ("netfilter: nft_inner: support for inner tunnel header matching")
> Reported-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
> Reported-by: Yuxiang Yang <yangyx22@mails.tsinghua.edu.cn>
> Reported-by: Xuewei Feng <fengxw06@126.com>
> Reported-by: Qi Li <qli01@tsinghua.edu.cn>
> Reported-by: Ke Xu <xuke@tsinghua.edu.cn>
> Assisted-by: GLM:5.1 Z.ai
> Signed-off-by: Yizhou Zhao <zhaoyz24@mails.tsinghua.edu.cn>
> ---
Please could you submit the patch as a new submission rather than a
reply to the old one?
In addition, the correct target tree is nf.git so use [PATCH nf]
instead, thanks!
> net/netfilter/nft_inner.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/net/netfilter/nft_inner.c b/net/netfilter/nft_inner.c
> index c4569d4b9..1b3e7a976 100644
> --- a/net/netfilter/nft_inner.c
> +++ b/net/netfilter/nft_inner.c
> @@ -163,7 +163,6 @@ static int nft_inner_parse_l2l3(const struct nft_inner *priv,
> return -1;
>
> if (fragoff == 0) {
> - thoff = nhoff + sizeof(_ip6h);
> ctx->flags |= NFT_PAYLOAD_CTX_INNER_TH;
> ctx->inner_thoff = thoff;
> ctx->l4proto = l4proto;
prev parent reply other threads:[~2026-05-11 16:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-10 13:19 [PATCH nft] netfilter: nft_inner: Fix IPv6 inner_thoff desync Yizhou Zhao
2026-05-11 12:39 ` Fernando Fernandez Mancera
2026-05-11 13:37 ` [PATCH v2 " Yizhou Zhao
2026-05-11 16:27 ` Fernando Fernandez Mancera [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5a17cb3e-72c6-404f-8bbf-cde2c9047b0f@suse.de \
--to=fmancera@suse.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fengxw06@126.com \
--cc=fw@strlen.de \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=phil@nwl.cc \
--cc=qli01@tsinghua.edu.cn \
--cc=stable@vger.kernel.org \
--cc=xuke@tsinghua.edu.cn \
--cc=yangyx22@mails.tsinghua.edu.cn \
--cc=zhaoyz24@mails.tsinghua.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox