Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760741AbXHUGy1 (ORCPT ); Tue, 21 Aug 2007 02:54:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760216AbXHUGw5 (ORCPT ); Tue, 21 Aug 2007 02:52:57 -0400 Received: from canuck.infradead.org ([209.217.80.40]:44165 "EHLO canuck.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756450AbXHUGwz (ORCPT ); Tue, 21 Aug 2007 02:52:55 -0400 Date: Mon, 20 Aug 2007 23:54:21 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: Justin Forbes , Zwane Mwaikambo , "Theodore Ts'o" , Randy Dunlap , Dave Jones , Chuck Wolber , Chris Wedgwood , Michael Krufky , Chuck Ebbert , Domenico Andreoli , torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, netdev@vger.kernel.org, Stephen Hemminger , Greg Kroah-Hartman Subject: [patch 06/20] sky2: check drop truncated packets Message-ID: <20070821065421.GG5275@kroah.com> References: <20070821064251.972690753@blue.kroah.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="sky2-stable-trunc.patch" In-Reply-To: <20070821065210.GA5275@kroah.com> User-Agent: Mutt/1.5.15 (2007-04-06) X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject. Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1349 Lines: 48 -stable review patch. If anyone has any objections, please let us know. ------------------ From: Stephen Hemminger Backport of commit 71749531f2d1954137a1a77422ef4ff29eb102dd If packet larger than MTU is received, the driver uses hardware to truncate the packet. Use the status registers to catch/drop them. Signed-off-by: Stephen Hemminger Signed-off-by: Greg Kroah-Hartman --- drivers/net/sky2.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -2065,6 +2065,9 @@ static struct sk_buff *sky2_receive(stru if (!(status & GMR_FS_RX_OK)) goto resubmit; + if (status >> 16 != length) + goto len_mismatch; + if (length < copybreak) skb = receive_copy(sky2, re, length); else @@ -2074,6 +2077,11 @@ resubmit: return skb; +len_mismatch: + /* Truncation of overlength packets + causes PHY length to not match MAC length */ + ++sky2->net_stats.rx_length_errors; + error: ++sky2->net_stats.rx_errors; if (status & GMR_FS_RX_FF_OV) { -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/