[BUG][PATCH] e1000: Fix invalid memory reference



Hi,

I encountered a kernel panic which was caused by the invalid memory
access by e1000 driver. The following patch fixes this issue.

Thanks,
Kenji Kaneshige


This patch fixes invalid memory reference in the e1000 driver which
would cause kernel panic.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@xxxxxxxxxxxxxx>

drivers/net/e1000/e1000_param.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)

Index: linux-2.6.15-rc5/drivers/net/e1000/e1000_param.c
===================================================================
--- linux-2.6.15-rc5.orig/drivers/net/e1000/e1000_param.c
+++ linux-2.6.15-rc5/drivers/net/e1000/e1000_param.c
@@ -545,7 +545,7 @@ e1000_check_fiber_options(struct e1000_a
static void __devinit
e1000_check_copper_options(struct e1000_adapter *adapter)
{
- int speed, dplx;
+ int speed, dplx, an;
int bd = adapter->bd_number;

{ /* Speed */
@@ -641,8 +641,12 @@ e1000_check_copper_options(struct e1000_
.p = an_list }}
};

- int an = AutoNeg[bd];
- e1000_validate_option(&an, &opt, adapter);
+ if (num_AutoNeg > bd) {
+ an = AutoNeg[bd];
+ e1000_validate_option(&an, &opt, adapter);
+ } else {
+ an = opt.def;
+ }
adapter->hw.autoneg_advertised = an;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [BUG][PATCH] e1000: Fix invalid memory reference
    ... > I encountered a kernel panic which was caused by the invalid memory ... > access by e1000 driver. ... The following patch fixes this issue. ... > Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • [BUG][PATCH] e1000: Fix invalid memory reference
    ... This patch fixes invalid memory reference in the e1000 driver which ... I encountered a kernel panic which was caused by the invalid memory ... access by e1000 driver. ... The following patch fixes this issue. ...
    (Linux-Kernel)
  • Re: [BUG][PATCH] e1000: Fix invalid memory reference
    ... But please noted that the current e1000 driver always refers invalid memory regardless of pci hotplug. ... incrementally when a new e1000 card is initialized. ... num_AutoNeg is 0 on my environment because I don't put any module options for e1000 driver. ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [RESEND] [PATCH 1/2] ipaq.c bugfixes
    ... | This patch fixes several problems in the ipaq.c driver with connecting ... | * If a write failed, the driver continued as if nothing happened. ...
    (Linux-Kernel)
  • Re: [PATCH] x86_84 pci_map_sg fix for 2.6.0-test7
    ... I ran into these asserts while testing with qlogic fc driver. ... > The patch fixes following: ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)