Re: [PATCH 1/4] lockdep: lock_set_subclass() fix

From: Yong Zhang
Date: Mon Nov 07 2011 - 08:32:23 EST


On Mon, Nov 07, 2011 at 01:34:39PM +0100, Peter Zijlstra wrote:
> On Fri, 2011-11-04 at 17:26 +0800, Yong Zhang wrote:
> > Since commit f59de89 [lockdep: Clear whole lockdep_map on initialization],
> > lockdep_init_map() will clear all the struct. But it will break
> > lock_set_class()/lock_set_subclass(). A typical race condition
> > is like below:
>
> This is a horridly ugly patch, why not simply revert that memset commit?

I prefer reverting that commit, but bugzilla is down and I don't know
what the real problem behind that commit.

> I really can't see the point of that, and keeping the name/key pointers
> around (which can only be over-written with the same values, right?)
> would also cure the problem.
>
> Sadly the changelog is completely devoid of useful information (which is
> my own damn fault, I should never have accepted the patch in that form),
> so I can't actually comment on what it was supposed to fix.

me too :(
And going through lkml history, I find nothing about it.

>
> Arguably kmemcheck is on crack or so since both name and key pointers
> should be in .data so there cannot be a leak by copying the thing over.

Maybe Tejun can give more detail on it.

Thanks,
Yong
--
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/