From: Manfred Spraul <manfred@colorfullife.com>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Jeff Garzik <jgarzik@pobox.com>,
Ayaz Abdulla <AAbdulla@nvidia.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Netdev <netdev@oss.sgi.com>
Subject: [PATCH] forcedeth: fix random memory scribbling bug
Date: Sat, 24 Dec 2005 14:19:24 +0100 [thread overview]
Message-ID: <43AD4ADC.8050004@colorfullife.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 405 bytes --]
Two critical bugs were found in forcedeth 0.47:
- TSO doesn't work.
- pci_map_single() for the rx buffers is called with size==0. This bug
is critical, it causes random memory corruptions on systems with an iommu.
Below is a minimal fix for both bugs, for inclusion into 2.6.15.
TSO will be fixed properly in the next version.
Tested on x86-64.
Signed-Off-By: Manfred Spraul <manfred@colorfullife.com>
[-- Attachment #2: patch-forcedeth-048-bugfixes --]
[-- Type: text/plain, Size: 2291 bytes --]
--- 2.6/drivers/net/forcedeth.c 2005-12-19 01:36:54.000000000 +0100
+++ x64/drivers/net/forcedeth.c 2005-12-24 12:16:30.000000000 +0100
@@ -10,7 +10,7 @@
* trademarks of NVIDIA Corporation in the United States and other
* countries.
*
- * Copyright (C) 2003,4 Manfred Spraul
+ * Copyright (C) 2003,4,5 Manfred Spraul
* Copyright (C) 2004 Andrew de Quincey (wol support)
* Copyright (C) 2004 Carl-Daniel Hailfinger (invalid MAC handling, insane
* IRQ rate fixes, bigendian fixes, cleanups, verification)
@@ -100,6 +100,7 @@
* 0.45: 18 Sep 2005: Remove nv_stop/start_rx from every link check
* 0.46: 20 Oct 2005: Add irq optimization modes.
* 0.47: 26 Oct 2005: Add phyaddr 0 in phy scan.
+ * 0.48: 24 Dec 2005: Disable TSO, bugfix for pci_map_single
*
* Known bugs:
* We suspect that on some hardware no TX done interrupts are generated.
@@ -111,7 +112,7 @@
* DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
* superfluous timer interrupts from the nic.
*/
-#define FORCEDETH_VERSION "0.47"
+#define FORCEDETH_VERSION "0.48"
#define DRV_NAME "forcedeth"
#include <linux/module.h>
@@ -871,8 +872,8 @@
} else {
skb = np->rx_skbuff[nr];
}
- np->rx_dma[nr] = pci_map_single(np->pci_dev, skb->data, skb->len,
- PCI_DMA_FROMDEVICE);
+ np->rx_dma[nr] = pci_map_single(np->pci_dev, skb->data,
+ skb->end-skb->data, PCI_DMA_FROMDEVICE);
if (np->desc_ver == DESC_VER_1 || np->desc_ver == DESC_VER_2) {
np->rx_ring.orig[nr].PacketBuffer = cpu_to_le32(np->rx_dma[nr]);
wmb();
@@ -999,7 +1000,7 @@
wmb();
if (np->rx_skbuff[i]) {
pci_unmap_single(np->pci_dev, np->rx_dma[i],
- np->rx_skbuff[i]->len,
+ np->rx_skbuff[i]->end-np->rx_skbuff[i]->data,
PCI_DMA_FROMDEVICE);
dev_kfree_skb(np->rx_skbuff[i]);
np->rx_skbuff[i] = NULL;
@@ -1334,7 +1335,7 @@
* the performance.
*/
pci_unmap_single(np->pci_dev, np->rx_dma[i],
- np->rx_skbuff[i]->len,
+ np->rx_skbuff[i]->end-np->rx_skbuff[i]->data,
PCI_DMA_FROMDEVICE);
{
@@ -2455,7 +2456,7 @@
np->txrxctl_bits |= NVREG_TXRXCTL_RXCHECK;
dev->features |= NETIF_F_HW_CSUM | NETIF_F_SG;
#ifdef NETIF_F_TSO
- dev->features |= NETIF_F_TSO;
+ /* disabled dev->features |= NETIF_F_TSO; */
#endif
}
next reply other threads:[~2005-12-24 13:20 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-24 13:19 Manfred Spraul [this message]
2005-12-24 15:09 ` [PATCH] forcedeth: fix random memory scribbling bug Jeff Garzik
2005-12-24 16:08 ` Manfred Spraul
2005-12-24 16:08 ` Manfred Spraul
2005-12-24 19:57 ` Linus Torvalds
2005-12-24 19:57 ` Linus Torvalds
2005-12-24 19:52 ` Linus Torvalds
2005-12-24 19:52 ` Linus Torvalds
2005-12-24 19:56 ` Manfred Spraul
2005-12-24 19:56 ` Manfred Spraul
2005-12-24 20:41 ` Linus Torvalds
2005-12-24 20:41 ` Linus Torvalds
2005-12-24 21:06 ` Jeff Garzik
2005-12-24 21:06 ` Jeff Garzik
2005-12-24 21:20 ` Francois Romieu
2005-12-24 19:58 ` Jeff Garzik
2005-12-24 19:58 ` Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43AD4ADC.8050004@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=AAbdulla@nvidia.com \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@oss.sgi.com \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.