kernel: fix crash with multicast-to-unicast and fraglist GRO
[openwrt/staging/pepe2k.git] / target / linux / generic / pending-6.1 / 681-net-bridge-fix-multicast-to-unicast-with-fraglist-GS.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Sat, 27 Apr 2024 18:54:25 +0200
3 Subject: [PATCH] net: bridge: fix multicast-to-unicast with fraglist GSO
4
5 Calling skb_copy on a SKB_GSO_FRAGLIST skb is not valid, since it returns
6 an invalid linearized skb. This code only needs to change the ethernet
7 header, so pskb_copy is the right function to call here.
8
9 Fixes: 6db6f0eae605 ("bridge: multicast to unicast")
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 ---
12
13 --- a/net/bridge/br_forward.c
14 +++ b/net/bridge/br_forward.c
15 @@ -261,7 +261,7 @@ static void maybe_deliver_addr(struct ne
16 if (skb->dev == p->dev && ether_addr_equal(src, addr))
17 return;
18
19 - skb = skb_copy(skb, GFP_ATOMIC);
20 + skb = pskb_copy(skb, GFP_ATOMIC);
21 if (!skb) {
22 DEV_STATS_INC(dev, tx_dropped);
23 return;