diff mbox

[net,1/1] r8169: fix kasan reported skb use-after-free.

Message ID 20151111223518.GA29672@electric-eye.fr.zoreil.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Francois Romieu Nov. 11, 2015, 10:35 p.m. UTC
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Reported-by: Dave Jones <davej@codemonkey.org.uk>
Fixes: d7d2d89d4b0af ("r8169: Add software counter for multicast packages")
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Corinna Vinschen <vinschen@redhat.com>
---

 Applies to davem's net as of c5a37883f42be712a989e54d5d6c0159b0e56599
 ("Merge branch 'akpm' (patches from Andrew)")

 4.2 needs it as well.

 drivers/net/ethernet/realtek/r8169.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

David Miller Nov. 12, 2015, 6:51 p.m. UTC | #1
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Wed, 11 Nov 2015 23:35:18 +0100

> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
> Reported-by: Dave Jones <davej@codemonkey.org.uk>
> Fixes: d7d2d89d4b0af ("r8169: Add software counter for multicast packages")
> Acked-by: Eric Dumazet <edumazet@google.com>
> Acked-by: Corinna Vinschen <vinschen@redhat.com>
> ---
> 
>  Applies to davem's net as of c5a37883f42be712a989e54d5d6c0159b0e56599
>  ("Merge branch 'akpm' (patches from Andrew)")
> 
>  4.2 needs it as well.

Applied and queued up for -stable, thanks!
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index b4f2123..79ef799 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -7429,15 +7429,15 @@  process_pkt:
 
 			rtl8169_rx_vlan_tag(desc, skb);
 
+			if (skb->pkt_type == PACKET_MULTICAST)
+				dev->stats.multicast++;
+
 			napi_gro_receive(&tp->napi, skb);
 
 			u64_stats_update_begin(&tp->rx_stats.syncp);
 			tp->rx_stats.packets++;
 			tp->rx_stats.bytes += pkt_size;
 			u64_stats_update_end(&tp->rx_stats.syncp);
-
-			if (skb->pkt_type == PACKET_MULTICAST)
-				dev->stats.multicast++;
 		}
 release_descriptor:
 		desc->opts2 = 0;