[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1368769782.3301.83.camel@edumazet-glaptop>
Date: Thu, 16 May 2013 22:49:42 -0700
From: Eric Dumazet <eric.dumazet@...il.com>
To: Stephen Hemminger <stephen@...workplumber.org>
Cc: romieu@...zoreil.com, nic_swsd@...ltek.com, netdev@...r.kernel.org
Subject: Re: [BUG] crash in 8139cp with 3.9.2 and KVM
On Thu, 2013-05-16 at 21:49 -0700, Stephen Hemminger wrote:
> Seeing the following panic when using emulated 8139cp with KVM and 3.9.2 kernel.
>
> Looks like netdev_alloc_skb_ip_align() can return a fragmented skb sometimes
> and using skb_put() on a non-linear skb causes a panic.
It looks like that len is not always less or equal to buflen.
I would try this fix :
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index 7d1fb9a..6488dec 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -494,7 +494,8 @@ rx_status_loop:
len = (status & 0x1fff) - 4;
mapping = le64_to_cpu(desc->addr);
- if ((status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag)) {
+ if ((status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag) ||
+ len > buflen) {
/* we don't support incoming fragmented frames.
* instead, we attempt to ensure that the
* pre-allocated RX skbs are properly sized such
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists