Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Dickson Wu via B4 Relay
Fri, 27 Nov 2026 21:09
[PATCH nf 0/2] netfilter: reject mismatched conntrack template protocols
Author: Dickson Wu via B4 Relay
Date: Fri, 27 Nov 2026 21:09
Date: Fri, 27 Nov 2026 21:09
47 lines
12343 bytes
12343 bytes
xt_CT under nft_compat can attach a helper or timeout policy selected from
NFTA_RULE_COMPAT_PROTO to packets of another protocol. The helper mismatch
also affects act_ct through the common template assignment path.
Reject mismatched helpers and timeout policies when a conntrack copies its
template state.
Tested under UML with KASAN, with the trigger running as uid 1000 in new
user and network namespaces (namespace-local CAP_NET_ADMIN only):
- nft_compat xt_CT with the H.323 RAS helper on TCP: stock panics in
mangle_contents(); patched completes; reverted panics again.
- act_ct with the RAS helper on TCP: stock panics in ras_help() from the
receive softirq; patched completes; reverted panics again.
- xt_CT with an ICMP timeout policy on TCP: stock gives a KASAN
slab-out-of-bounds read in nf_conntrack_tcp_packet(); patched keeps the
default TCP timeout; reverted reads out of bounds again.
- Matching-protocol controls still work: UDP H.323, TCP FTP, and ICMP
and UDP timeout policies.
W=1 builds are clean. The rule-load checks in xt_CT and nft_ct already
require an exact protocol match, so valid configurations are unaffected.
The gap is nft_compat not enforcing its compat protocol per packet, and
act_ct.
A reproducer is available if it helps.
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.
---
Dickson Wu (2):
netfilter: conntrack: reject helper protocol mismatch
netfilter: conntrack: reject timeout protocol mismatch
net/netfilter/nf_conntrack_core.c | 10 +++++++---
net/netfilter/nf_conntrack_helper.c | 2 ++
2 files changed, 9 insertions(+), 3 deletions(-)
---
base-commit: 734bef548a96e8774d6eef5dfa2026c6edc4e80b
change-id: 20261127-nf-ctproto2-0508bd9bfeb7
Best regards,
--
Dickson Wu <dickson.wu@certik.com>
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