Re: [PATCH 002 of 6] md: Fix use-after-free bug when dropping an rdev from an md array.

From: Al Viro
Date: Sun Jan 13 2008 - 21:05:21 EST


On Mon, Jan 14, 2008 at 12:45:31PM +1100, NeilBrown wrote:
>
> Due to possible deadlock issues we need to use a schedule work to
> kobject_del an 'rdev' object from a different thread.
>
> A recent change means that kobject_add no longer gets a refernce, and
> kobject_del doesn't put a reference. Consequently, we need to
> explicitly hold a reference to ensure that the last reference isn't
> dropped before the scheduled work get a chance to call kobject_del.
>
> Also, rename delayed_delete to md_delayed_delete to that it is more
> obvious in a stack trace which code is to blame.

I don't know... You still get kobject_del() and export_rdev()
in unpredictable order; sure, it won't be freed under you, but...

What is that deadlock problem, anyway? I don't see anything that
would look like an obvious candidate in the stuff you are delaying...
--
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/