macvlan_broadcast_one() forwards received broadcast and multicast
traffic to macvlan devices. Receive-side flooding passes a mode mask,
so bridge-mode receive clones take the same non-local path as private,
VEPA, and passthru clones. Only bridge-mode transmit flooding takes the
local __dev_forward_skb() path, which scrubs the skb.
The source-MAC receive path can also hand the original skb to
macvlan_broadcast_one(). In every non-local case, an unconfirmed
conntrack entry attached by tc act_ct can remain shared with another
delivery. Concurrent netfilter processing may then reallocate or free
conntrack extensions while another skb accesses them.
Reset conntrack state on every non-local broadcast delivery before
passing the skb to the macvlan device.
Fixes: b57dc7c13ea9 ("net/sched: Introduce action ct")
Reviewed-by: Juan Agustin Niccolini <juan…@gmail.com>
Tested-by: Juan Agustin Niccolini <juan…@gmail.com>
Signed-off-by: Kyuwon Cho <kyuw…@skku.edu>
---
This issue was found by an LLM-guided test generator.
A reproducer is available on request.
Changes in v2:
- Rename the patch to cover every broadcast delivery, not only clones.
- Explain the receive mode mask, bridge transmit path, and original-skb
source-MAC path. The code is unchanged.
Links:
- v1: https://lore.kernel.org/all/1796…@skku.edu/
- Sashiko review: https://lore.kernel.org/all/1796…@kernel.org/
- Juan's source-mode v2: https://lore.kernel.org/all/2026…@gmail.com/
drivers/net/macvlan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 4f8416bb5169..237744d6bfc2 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -237,6 +237,7 @@ static int macvlan_broadcast_one(struct sk_buff *skb,
if (local)
return __dev_forward_skb(dev, skb);
+ nf_reset_ct(skb);
skb->dev = dev;
if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast))
skb->pkt_type = PACKET_BROADCAST;
--
2.43.0