Skip to contentSkip to conversation

netfilter: nf_tables: hide clash bit from userspace

PATCH Applied Florian Westphal 2 participants 2 messages Jul 7, 2025 – Jul 14, 2025

Subsystems (2)
lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 netfilter: nf_tables: hide clash bit from userspace

Its a kernel implementation detail, at least at this time:

We can later decide to revert this patch if there is a compelling reason, but then we should also remove the ifdef that prevents exposure of ip_conntrack_status enum IPS_NAT_CLASH value in the uapi header.

Clash entries are not included in dumps (true for both old /proc and ctnetlink) either. So for now exlude the clash bit when dumping.

Fixes 7e5c6aa67e6f ("netfilter: nf_tables: add packets conntrack state to debug trace info")
---
 net/netfilter/nf_tables_trace.c | 3 +++
 1 file changed, 3 insertions(+)
net/netfilter/nf_tables_trace.c +3 -0
index ae3fe87195ab..a88abae5a9de 100644
@@ -127,6 +127,9 @@ static int nf_trace_fill_ct_info(struct sk_buff *nlskb,
 		if (nla_put_be32(nlskb, NFTA_TRACE_CT_ID, (__force __be32)id))
 			return -1;
 
+		/* Kernel implementation detail, withhold this from userspace for now */
+		status &= ~IPS_NAT_CLASH;
+
 		if (status && nla_put_be32(nlskb, NFTA_TRACE_CT_STATUS, htonl(status)))
 			return -1;
 	}
Signature · 1 line
2.49.0
maintainer Applied
#1 lore raw
Quoted 8 lines · Florian Westphal

Its a kernel implementation detail, at least at this time:

We can later decide to revert this patch if there is a compelling reason, but then we should also remove the ifdef that prevents exposure of ip_conntrack_status enum IPS_NAT_CLASH value in the uapi header.

Clash entries are not included in dumps (true for both old /proc and ctnetlink) either. So for now exlude the clash bit when dumping.

Applied to nf.git, thanks