Re: Oops in 2.6.10-rc1 (almost solved)

From: Matt Domsch
Date: Sat Nov 13 2004 - 09:31:21 EST


On Fri, Nov 12, 2004 at 10:45:12PM -0500, Chuck Ebbert wrote:
> On Tue, 9 Nov 2004 at 17:01:10 -0800 Linus Torvalds <torvalds@xxxxxxxx> wrote:
>
> > > PS: do you have *any* idea how this could be related to the snd-es1371
> > > driver (which is producing the oops then)?
> >
> > I bet it's overwriting some array, and just corrupting memory after it.
> > For example, the edd_info[] array only has 6 entries,
>
> That's almost certainly the problem. There can be up to 16 EDD devices
> as of the Jun 30 update to the EDD code.

Bingo... edd_devices[] was too short. When we keep more
than 6 signatures, it overruns the end. Also, I rewrote
edd_num_devices to be clearer about its goal.

This patch is necessary even after the last edd.S patch was reverted.

It still doesn't explain why Christian's BIOS reports more devices
than he has, that's still UI, so don't re-apply the edd.S patch just reverted.

Signed-off-by: Matt Domsch

--
Matt Domsch
Sr. Software Engineer, Lead Engineer
Dell Linux Solutions linux.dell.com & www.dell.com/linux
Linux on Dell mailing lists @ http://lists.us.dell.com

===== drivers/firmware/edd.c 1.30 vs edited =====
--- 1.30/drivers/firmware/edd.c 2004-06-29 09:44:48 -05:00
+++ edited/drivers/firmware/edd.c 2004-11-13 07:56:00 -06:00
@@ -70,7 +70,7 @@
static int edd_dev_is_type(struct edd_device *edev, const char *type);
static struct pci_dev *edd_get_pci_dev(struct edd_device *edev);

-static struct edd_device *edd_devices[EDDMAXNR];
+static struct edd_device *edd_devices[EDD_MBR_SIG_MAX];

#define EDD_DEVICE_ATTR(_name,_mode,_show,_test) \
struct edd_attribute edd_attr_##_name = { \
@@ -728,9 +728,9 @@

static inline int edd_num_devices(void)
{
- return min_t(unsigned char,
- max_t(unsigned char, edd.edd_info_nr, edd.mbr_signature_nr),
- max_t(unsigned char, EDD_MBR_SIG_MAX, EDDMAXNR));
+ return max_t(unsigned char,
+ min_t(unsigned char, EDD_MBR_SIG_MAX, edd.mbr_signature_nr),
+ min_t(unsigned char, EDDMAXNR, edd.edd_info_nr));
}

/**
-
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/