* [PATCH nf v2] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag()
@ 2026-10-20 13:29 Laveesh Bansal
0 siblings, 0 replies; only message in thread
From: Laveesh Bansal @ 2026-10-20 13:29 UTC (permalink / raw)
To: Pablo Neira Ayuso, Florian Westphal
Cc: Nikolay Aleksandrov, Ido Schimmel, netfilter-devel, coreteam,
bridge, netdev
nf_ct_bridge_refrag() warns when skb->protocol is neither IPv4 nor IPv6.
A vlan filtering bridge can get there with a vlan ethertype: if the
protocol of the tag of a frame differs from the vlan_protocol of the
bridge, br_allowed_ingress() moves the tag back into the packet after
NF_BR_PRE_ROUTING, where bridge conntrack has already defragmented it.
Anyone who can send fragments into a port of such a bridge can trigger the
warning, which takes the machine down with panic_on_warn. The packet is
dropped either way, so only warn on kernels built with CONFIG_DEBUG_NET.
This only avoids the warning. Such fragmented packets are still dropped.
syzbot reported the warning. It keeps triggering on CONFIG_DEBUG_NET
kernels until the vlan tag is handled, which is left for a follow-up:
https://syzkaller.appspot.com/bug?extid=a8ba738fe2db6b4bb27f
Fixes: 3c171f496ef5 ("netfilter: bridge: add connection tracking system")
Assisted-by: LLM
Signed-off-by: Laveesh Bansal <laveeshb@laveeshbansal.com>
---
v2:
- Reduced to DEBUG_NET_WARN_ON_ONCE(), as suggested by Pablo. Handling the
vlan tag and the selftest will follow for nf-next.
- Dropped Reported-by, Closes and Cc: stable. This does not fix the syzbot
report, its config has CONFIG_DEBUG_NET=y.
- Only the commit that added the warning is listed in Fixes:.
v1: https://lore.kernel.org/r/20261020005403.38212-1-laveeshb@laveeshbansal.com
net/bridge/netfilter/nf_conntrack_bridge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bridge/netfilter/nf_conntrack_bridge.c b/net/bridge/netfilter/nf_conntrack_bridge.c
index b5444335b86f..8c83dc05114b 100644
--- a/net/bridge/netfilter/nf_conntrack_bridge.c
+++ b/net/bridge/netfilter/nf_conntrack_bridge.c
@@ -358,7 +358,7 @@ nf_ct_bridge_refrag(struct sk_buff *skb, const struct nf_hook_state *state,
nf_br_ip6_fragment(state->net, state->sk, skb, &data, output);
break;
default:
- WARN_ON_ONCE(1);
+ DEBUG_NET_WARN_ON_ONCE(1);
return NF_DROP;
}
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-10-20 13:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-20 13:29 [PATCH nf v2] netfilter: bridge: use DEBUG_NET_WARN_ON_ONCE in nf_ct_bridge_refrag() Laveesh Bansal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox