From: Florian Westphal <fw@strlen.de>
To: Jiayuan Chen <jiayuan.chen@linux.dev>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: [PATCH nf] netfilter: nft_ct: fix OOB in NFT_CT_SRC/DST eval
Date: Thu, 28 May 2026 10:01:32 +0200 [thread overview]
Message-ID: <ahf2XAmRnsjK0krp@strlen.de> (raw)
In-Reply-To: <58fc5150-76e7-46e5-a72f-41133c408109@linux.dev>
Jiayuan Chen <jiayuan.chen@linux.dev> wrote:
> > > > nf_ct_l3num(ct) == NFPROTO_IPV6 ? 16 : 4);
> > > As defense-in-depth, IIUC?
> > Yes, alternatively merge your v1 with the template check. I don't see how
> > we can ever have nf_ct_l3num(ct) != nft_pf(pkt) outside of the template
> > bug.
> I think the template check plus the family check (nf_ct_l3num(ct) !=
> nft_pf(pkt)) is enough as defense-in-depth.
Actually, I think we need to fix this to copy priv->len unconditionally.
Or, alternatively, add a memcpy wrapper that zero-pads the remainder of
the registers.
https://sashiko.dev/#/patchset/20260528042620.263828-1-jiayuan.chen%40linux.dev
"This is a pre-existing issue, but does copying only addr_len bytes when
priv->len is larger leave the remainder of the register uninitialized?
In nft_do_chain(), the register array is allocated on the kernel stack
without zero-initialization. If priv->len is 16 and addr_len is 4, only
the first 4 bytes are written."
next prev parent reply other threads:[~2026-05-28 8:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 4:26 [PATCH nf] netfilter: nft_ct: fix OOB in NFT_CT_SRC/DST eval Jiayuan Chen
2026-05-28 5:19 ` Florian Westphal
2026-05-28 5:43 ` Florian Westphal
2026-05-28 7:02 ` Jiayuan Chen
2026-05-28 7:10 ` Florian Westphal
2026-05-28 7:27 ` Jiayuan Chen
2026-05-28 8:01 ` Florian Westphal [this message]
2026-05-28 8:25 ` Jiayuan Chen
2026-05-28 9:31 ` Florian Westphal
2026-05-28 10:03 ` Pablo Neira Ayuso
2026-05-28 10:24 ` Florian Westphal
2026-05-28 10:26 ` Jiayuan Chen
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=ahf2XAmRnsjK0krp@strlen.de \
--to=fw@strlen.de \
--cc=jiayuan.chen@linux.dev \
--cc=netfilter-devel@vger.kernel.org \
/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