blob: 5704d05aad061c40660850ac4c6a32a9ba0df592 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
2Date: Fri, 31 Jul 2020 19:26:16 +0300
3Subject: [PATCH] net: bridge: clear bridge's private skb space on xmit
4
5We need to clear all of the bridge private skb variables as they can be
6stale due to the packet being recirculated through the stack and then
7transmitted through the bridge device. Similar memset is already done on
8bridge's input. We've seen cases where proxyarp_replied was 1 on routed
9multicast packets transmitted through the bridge to ports with neigh
10suppress which were getting dropped. Same thing can in theory happen with
11the port isolation bit as well.
12
13Fixes: 821f1b21cabb ("bridge: add new BR_NEIGH_SUPPRESS port flag to suppress arp and nd flood")
14Signed-off-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
15Signed-off-by: David S. Miller <davem@davemloft.net>
16---
17
18--- a/net/bridge/br_device.c
19+++ b/net/bridge/br_device.c
20@@ -35,6 +35,8 @@ netdev_tx_t br_dev_xmit(struct sk_buff *
21 const unsigned char *dest;
22 u16 vid = 0;
23
24+ memset(skb->cb, 0, sizeof(struct br_input_skb_cb));
25+
26 rcu_read_lock();
27 nf_ops = rcu_dereference(nf_br_ops);
28 if (nf_ops && nf_ops->br_dev_xmit_hook(skb)) {