Re: lockdep: BUG: key ffff880436f00330 not in .data!

From: Borislav Petkov
Date: Sun May 12 2013 - 11:37:30 EST


On Thu, May 09, 2013 at 10:01:08PM +0200, Borislav Petkov wrote:
> On Thu, May 09, 2013 at 11:28:08AM -0300, Mauro Carvalho Chehab wrote:
> > Could you please check if ghes_edac also got registered there?

Ok, I got it:

[ 5.430408] BUG: key ffff88043c320330 not in .data!
[ 5.431043] ------------[ cut here ]------------
[ 5.431776] WARNING: at kernel/lockdep.c:2987 lockdep_init_map+0x555/0x590()
[ 5.432512] DEBUG_LOCKS_WARN_ON(1)

basically means we're using dynamically allocated memory for the
lock_key. And the last can thus disappear, which is Not Good(tm).

This happens because the EDAC instance probing functions do
edac_mc_alloc() to allocate the mci which also contains embedded in it:

struct bus_type bus;

and the bus_register() call in edac_create_sysfs_mci_device() hands down
this struct bus_type to lockdep.

The patch which introduced the bus_register() call in
edac_create_sysfs_mci_device() is

--
commit de3910eb79ac8c0f29a11224661c0ebaaf813039
Author: Mauro Carvalho Chehab <mchehab@xxxxxxxxxx>
Date: Tue Apr 24 15:05:43 2012 -0300

edac: change the mem allocation scheme to make Documentation/kobject.txt happy
--

which means we need a fix since this affects all edac drivers, not only
sb_edac, as initially surmised.

Thanks.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
--
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/