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

From: Ingo Molnar
Date: Mon Jan 28 2008 - 07:25:33 EST



* Greg Kroah-Hartman <gregkh@xxxxxxx> wrote:

> This problem is due to the kobject rework recently done in this file.
>
> The mce_amd_64.c code uses some wierd forward calls to back out of the
> recursive way the code creates kobjects. Because of this, we need to
> verify that we have really created a kobject before calling
> kobject_uevent().
>
> Many thanks to Yinghai Lu <yhlu.kernel@xxxxxxxxx> for reporting the
> problem and testing.

> - kobject_uevent(&b->kobj, KOBJ_ADD);
> + if (b)
> + kobject_uevent(&b->kobj, KOBJ_ADD);

Acked-by: Ingo Molnar <mingo@xxxxxxx>

and please let me insert a minor kobject rant here: i do think it's way
too hard to figure out relatively minor-looking kobj bugs like this. It
took serious dedication from Yinghai Lu and yourself to nail this down,
and we wont always have that much luck in the future.

CONFIG_DEBUG_KOBJECT is way too feeble and does not actually attempt to
catch bugs like this. The effects of the bug were quite serious, and
this hasnt been the first time such hard-to-find kobj bugs occured -
every one of those incidents was in essence unnecessary.

Couldnt DEBUG_KOBJECT do better than this - just like we have list
debugging, PAGEALLOC and all the other debug checks?

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