Thread View: linux.kernel.netdev
2 messages
2 total messages
Started by Dickson Wu via B4 Relay
Fri, 27 Nov 2026 18:12
[PATCH nf 1/2] netfilter: conntrack: reject helper protocol mismatch
Author: Dickson Wu via B4 Relay
Date: Fri, 27 Nov 2026 18:12
Date: Fri, 27 Nov 2026 18:12
40 lines
11855 bytes
11855 bytes
From: Dickson Wu <dickson.wu@certik.com>
Conntrack templates can carry helpers selected from rule metadata instead
of the packet protocol. nft_compat does not enforce its compatibility
protocol when evaluating packets, so xt_CT can attach a UDP helper to a
TCP conntrack. act_ct can likewise attach a helper configured for another
protocol.
Helpers parse transport headers according to helper->l4proto. With the
H.323 RAS helper attached to TCP traffic, NAT mangling in
mangle_contents() crashes. Refuse to copy a template helper unless it
matches the new conntrack protocol. This covers all template users in
the common assignment path.
Fixes: 84f3bb9ae9db ("netfilter: xtables: add CT target")
Signed-off-by: Dickson Wu <dickson.wu@certik.com>
---
This was found and the fix prepared with AI coding tools (OpenAI Codex
agents, with review by Claude). I went over the analysis and the patch
before signing off.
net/netfilter/nf_conntrack_helper.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c
index c30ae3f203..91bd11f01f 100644
--- a/net/netfilter/nf_conntrack_helper.c
+++ b/net/netfilter/nf_conntrack_helper.c
@@ -209,6 +209,8 @@ int __nf_ct_try_assign_helper(struct nf_conn *ct, struct nf_conn *tmpl,
help = nfct_help(tmpl);
if (help)
helper = rcu_dereference(help->helper);
+ if (helper && helper->l4proto != nf_ct_protonum(ct))
+ helper = NULL;
help = nfct_help(ct);
--
2.43.0
Re: [PATCH nf 1/2] netfilter: conntrack: reject helper protocol mismatch
Author: Pablo Neira Ayuso
Date: Sat, 28 Nov 2026 22:02
Date: Sat, 28 Nov 2026 22:02
30 lines
9382 bytes
9382 bytes
On Fri, Nov 27, 2026 at 06:12:10PM +0000, Dickson Wu via B4 Relay wrote:
> From: Dickson Wu <dickson.wu@certik.com>
>
> Conntrack templates can carry helpers selected from rule metadata instead
> of the packet protocol. nft_compat does not enforce its compatibility
> protocol when evaluating packets, so xt_CT can attach a UDP helper to a
> TCP conntrack. act_ct can likewise attach a helper configured for another
> protocol.
>
> Helpers parse transport headers according to helper->l4proto. With the
> H.323 RAS helper attached to TCP traffic, NAT mangling in
> mangle_contents() crashes. Refuse to copy a template helper unless it
> matches the new conntrack protocol. This covers all template users in
> the common assignment path.
>
> Fixes: 84f3bb9ae9db ("netfilter: xtables: add CT target")
> Signed-off-by: Dickson Wu <dickson.wu@certik.com>
> ---
> This was found and the fix prepared with AI coding tools (OpenAI Codex
> agents, with review by Claude). I went over the analysis and the patch
> before signing off.
There is ongoing work in the mailing list.
Your LLM is just reporting you something for which there are already
patches on the mailing list?
Could you please check the mailing list before posting duplicate
patches?
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads