Re: drivers/char/random.c line 728 BUG

From: Matt Mackall
Date: Wed Sep 03 2008 - 18:14:51 EST



On Wed, 2008-09-03 at 11:28 -0700, Aaron Straus wrote:
> Hi Matt,
>
> On Sep 03 01:18 PM, Matt Mackall wrote:
> > This fix is bogus - it assumes that r->entropy_count has atomic
> > assignment which is not universally true (witness the existence of
> > atomic_t). So we can still observe partial updates to entropy_count on
> > some architectures. Now it's probably the case that we'll never see a
> > partial update that actually triggers the BUG_ON, but it's still
> > conceptually wrong to do things this way.
>
> I think Andrew was just being safe by reverting to the old behavior.

Indeed. I've no doubt that his fix works and I'm certainly glad you guys
took the time to fix things while I was away. I just think the resulting
fix is a little silly.

> Could we still apply his patch for the upcoming stable tree and fix it
> the "right" way at some point in the future?

I'm not sure what the current state of play is here in terms of the
original patch being pushed to stable and mainline, but my patch is both
simpler and more correct. If it's not too late, it's the one that should
go to both places.

--
Mathematics is the supreme nostalgia of our time.

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