Re: [PATCH 2/5] x86: fix runtime error in arch/x86/kernel/cpu/mcheck/mce_amd_64.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Monday, January 28, 2008 - 10:37 am

On Mon, Jan 28, 2008 at 01:24:34PM +0100, Ingo Molnar wrote:

In fact, it is exactly what enabled me to catch this bug.  The fact that
the kobject_uevent() debugging statment did not print out anything, and
oopsed, showed me that this was a simpler problem than I was originally
thinking it was.

Problem was we were passing in 0x18 for a kobject pointer to the
kobject_uevent() function.  Even checking for NULL there would not have
caught this.

I have added a lot more "robustness" checks to the kobject core now, see
the lkml messages about the maple bus for examples of where it is
catching real problems already.  And the kobject debugging code is now
"unified", printing out everything in a standard, easy to understand
manner.

I really don't want to get into adding a "magic value" to a kobject
field, and then checking it for every call, that too would have died on
this kind of bug, just like the debug printk did :)

But if there's anything that you think I can add to make it easier to
understand, please let me know.

The root problem of this bug was us using a goto to call forward into a
major code block within a function.  Not just using a goto for error
cleanup, like the kernel code "normally" does.  Because of that, I
totally missed this code path when reading the function many times.
It's nasty code complexity for no reason at all that causes more
problems than is needed, combined with a total lack of documentation for
how this kobject userspace interface is supposed to be used, that needs
to be fixed.

thanks,

greg k-h
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[GIT PATCH] driver core fixes against 2.6.24, Greg KH, (Sun Jan 27, 4:37 pm)
[PATCH 1/5] Driver core: Fix up build when CONFIG_BLOCK=N, Greg Kroah-Hartman, (Sun Jan 27, 4:38 pm)
[PATCH 2/5] x86: fix runtime error in arch/x86/kernel/cpu/ ..., Greg Kroah-Hartman, (Sun Jan 27, 4:38 pm)
[PATCH 3/5] Module: check to see if we have a built in mod ..., Greg Kroah-Hartman, (Sun Jan 27, 4:38 pm)
[PATCH 4/5] Driver core: add bus_find_device_by_name function, Greg Kroah-Hartman, (Sun Jan 27, 4:38 pm)
[PATCH 5/5] PPC: Fix powerpc vio_find_name to not use devi ..., Greg Kroah-Hartman, (Sun Jan 27, 4:38 pm)
Re: [PATCH 2/5] x86: fix runtime error in arch/x86/kernel/ ..., Greg KH, (Mon Jan 28, 10:37 am)