linux/drivers
Ingo Molnar bbbab5ca83 natsemi: fix oops, link back netdevice from private-struct
* Andrew Nelless <andrew@nelless.net> wrote:

> Hi,
>
> I booted up 2.6.24-rc1 this morning [Real early over a brew ;-)] and
> was having a problems with multiple ~5 second hangs on SATA/drive init
> (Something to do with "EH" something-or-other and resets but I'll
> email in separately about it later unless its fixed by the time I get
> the chance).
>
> Anyway, I went to fire up netconsole to get a decent log dump and hit
> across the following nasty. Netconsole works fine in 2.6.23.1 with a
> similar config and the same kernel parameters.
>
> A shot of the screen is the only method I could come up with to
> capture the log, I hope that is OK, it is pretty readable.
>
>
> The nasty:
> http://andotnet.nfshost.com/linux/2.6.24-rc1-netconsole-nullderef.jpg

the NULL dereference is here:

 (gdb) list *0xffffffff804a9504
 0xffffffff804a9504 is in natsemi_poll (drivers/net/natsemi.c:717).
 712             return count;
 713     }
 714
 715     static inline void __iomem *ns_ioaddr(struct net_device *dev)
 716     {
 717             return (void __iomem *) dev->base_addr;
 718     }
 719

which is this code from natsemi.c:

 2227            struct net_device *dev = np->dev;
 2228            void __iomem * ioaddr = ns_ioaddr(dev);
 2229            int work_done = 0;

seems like the NAPI changes in -rc1 added an np->dev field but forgot to
initialize it ...

does the patch below fix the oops for you?

	Ingo

-------------------->
Subject: natsemi: fix oops, link back netdevice from private-struct
From: Ingo Molnar <mingo@elte.hu>

this commit:

  commit bea3348eef
  Author: Stephen Hemminger <shemminger@linux-foundation.org>
  Date:   Wed Oct 3 16:41:36 2007 -0700

      [NET]: Make NAPI polling independent of struct net_device objects.

added np->dev to drivers/net/natsemi.c's struct netdev_private, but
forgot to initialize that new field upon driver init. The result was
a predictable NULL dereference oops the first time the hardware
generated an interrupt.

Reported-by: Andrew Nelless <andrew@nelless.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
2007-10-25 03:31:14 -04:00
..
acorn/char unicode diacritics support 2007-10-17 08:42:52 -07:00
acpi Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-10-19 20:36:17 -07:00
amba Driver core: change add_uevent_var to use a struct 2007-10-12 14:51:01 -07:00
ata libata: add HTS542525K9SA00 to NCQ blacklist 2007-10-23 21:20:02 -04:00
atm Eliminate pointless casts from void* in a few driver irq handlers. 2007-10-23 19:53:16 -04:00
auxdisplay
base memory hotplug: rearrange memory hotplug notifier 2007-10-22 08:13:17 -07:00
block [PATCH] Fix breakage after SG cleanups 2007-10-23 12:02:39 -07:00
bluetooth [Bluetooth] Add generic driver for Bluetooth USB devices 2007-10-22 02:59:46 -07:00
cdrom Use helpers to obtain task pid in printks 2007-10-19 11:53:43 -07:00
char drivers/char/riscom8: clean up irq handling 2007-10-23 19:53:17 -04:00
clocksource
connector
cpufreq Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6 2007-10-12 15:49:37 -07:00
cpuidle
crypto
dca I/OAT: Add DCA services 2007-10-16 09:43:09 -07:00
dio
dma I/OAT: Add completion callback for async_tx interface use 2007-10-18 14:37:32 -07:00
edac NULL terminate the pci_device_ids in pasemi_edac 2007-10-19 11:53:56 -07:00
eisa signedness: module_param_array nump argument 2007-10-14 12:41:52 -07:00
firewire firewire: fw-ohci: shut up a superfluous compiler warning 2007-10-22 19:48:56 +02:00
firmware define global BIT macro 2007-10-19 11:53:42 -07:00
hid changed email 2007-10-20 00:47:32 +02:00
hwmon Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-10-19 20:36:17 -07:00
i2c typo fixes 2007-10-20 01:34:40 +02:00
ide ide: build fix 2007-10-23 09:49:29 +02:00
ieee1394 [PATCH] Fix breakage after SG cleanups 2007-10-23 12:02:39 -07:00
infiniband Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband 2007-10-23 09:56:11 -07:00
input [PARPORT] Remove unused 'irq' argument from parport irq functions 2007-10-23 19:53:16 -04:00
isdn isdn/sc: irq handler clean 2007-10-23 19:53:16 -04:00
kvm Consolidate host virtualization support under Virtualization menu 2007-10-23 15:49:47 +10:00
leds fix typo "sort" -> "short" 2007-10-20 01:55:58 +02:00
lguest generalize lgread_u32/lgwrite_u32. 2007-10-23 15:49:56 +10:00
macintosh Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-10-19 20:36:17 -07:00
mca
md md: raid5: fix clearing of biofill operations 2007-10-23 08:32:06 -07:00
media [PATCH] Fix breakage after SG cleanups 2007-10-23 12:02:39 -07:00
message Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
mfd typo fixes 2007-10-20 01:34:40 +02:00
misc typo fixes 2007-10-20 01:34:40 +02:00
mmc [PATCH] Fix breakage after SG cleanups 2007-10-23 12:02:39 -07:00
mtd Eliminate pointless casts from void* in a few driver irq handlers. 2007-10-23 19:53:16 -04:00
net natsemi: fix oops, link back netdevice from private-struct 2007-10-25 03:31:14 -04:00
nubus
of [SPARC/64]: Consolidate of_register_driver 2007-10-17 21:17:42 -07:00
oprofile
parisc parisc: fix sg_page() fallout 2007-10-23 09:49:31 +02:00
parport [PARPORT] Remove unused 'irq' argument from parport irq functions 2007-10-23 19:53:16 -04:00
pci jmicron: update quirk for JMB361/3/5/6 2007-10-23 21:20:02 -04:00
pcmcia remove asm/bitops.h includes 2007-10-19 11:53:41 -07:00
pnp PNP: add debug message for adding new device 2007-10-17 08:43:04 -07:00
power Merge git://git.infradead.org/battery-2.6 2007-10-22 19:20:52 -07:00
ps3 remove asm/bitops.h includes 2007-10-19 11:53:41 -07:00
rapidio
rtc typo fixes 2007-10-20 01:34:40 +02:00
s390 s390 zfcp: sg fixups 2007-10-23 09:17:53 +02:00
sbus vfc_dev conversion to mutex: fallout 2007-10-20 15:04:06 -07:00
scsi Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2007-10-23 16:37:29 -07:00
serial m68knommu: new style ColdFire UART driver 2007-10-23 08:32:34 -07:00
sh
sn
spi Fix misspellings of "system", "controller", "interrupt" and "necessary". 2007-10-19 23:10:43 +02:00
ssb [PATCH] ssb: fix build failure 2007-10-16 21:04:11 -04:00
tc lk201: remove obsolete driver 2007-10-17 08:42:57 -07:00
telephony kconfig: syntax cleanup - drop support for "depends/requires/def_boolean" 2007-10-12 21:20:32 +02:00
uio
usb [PARPORT] Kill useful 'irq' arg from parport_{generic_irq,ieee1284_interrupt} 2007-10-23 19:53:15 -04:00
video Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial 2007-10-19 20:36:17 -07:00
virtio Virtio helper routines for a descriptor ringbuffer implementation 2007-10-23 15:49:55 +10:00
w1 Add missing newlines to some uses of dev_<level> messages 2007-10-18 14:37:28 -07:00
watchdog [WATCHDOG] AR7: watchdog timer 2007-10-23 20:35:13 +00:00
xen Add missing newlines to some uses of dev_<level> messages 2007-10-18 14:37:28 -07:00
zorro Convert files to UTF-8 and some cleanups 2007-10-19 23:21:04 +02:00
Kconfig Virtio interface 2007-10-23 15:49:54 +10:00
Makefile Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 2007-10-23 16:37:29 -07:00