Commit 39174291 authored by françois romieu's avatar françois romieu Committed by David S. Miller

r8169: fix kasan reported skb use-after-free.

Signed-off-by: default avatarFrancois Romieu <romieu@fr.zoreil.com>
Reported-by: default avatarDave Jones <davej@codemonkey.org.uk>
Fixes: d7d2d89d ("r8169: Add software counter for multicast packages")
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarCorinna Vinschen <vinschen@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c5a37883
...@@ -7429,15 +7429,15 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget ...@@ -7429,15 +7429,15 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
rtl8169_rx_vlan_tag(desc, skb); rtl8169_rx_vlan_tag(desc, skb);
if (skb->pkt_type == PACKET_MULTICAST)
dev->stats.multicast++;
napi_gro_receive(&tp->napi, skb); napi_gro_receive(&tp->napi, skb);
u64_stats_update_begin(&tp->rx_stats.syncp); u64_stats_update_begin(&tp->rx_stats.syncp);
tp->rx_stats.packets++; tp->rx_stats.packets++;
tp->rx_stats.bytes += pkt_size; tp->rx_stats.bytes += pkt_size;
u64_stats_update_end(&tp->rx_stats.syncp); u64_stats_update_end(&tp->rx_stats.syncp);
if (skb->pkt_type == PACKET_MULTICAST)
dev->stats.multicast++;
} }
release_descriptor: release_descriptor:
desc->opts2 = 0; desc->opts2 = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment