Messages in this thread Patch in this message | | | Date | Fri, 29 Aug 2008 12:54:45 -0700 | From | Andrew Morton <> | Subject | Re: drivers/char/random.c line 728 BUG |
| |
On Fri, 29 Aug 2008 12:48:07 -0700 Andrew Morton <akpm@linux-foundation.org> wrote:
> We could fix this by moving the assertion inside the lock, but it seems > safer and saner to revert to the old behaviour wherein > entropy_store.entropy_count at no time exceeds > entropy_store.poolinfo->POOLBITS.
The fixed version even generates improved code.
Let's try to avoid repeats:
--- a/drivers/char/random.c~drivers-char-randomc-fix-a-race-which-can-lead-to-a-bogus-bug-fix +++ a/drivers/char/random.c @@ -407,7 +407,7 @@ struct entropy_store { /* read-write data: */ spinlock_t lock; unsigned add_ptr; - int entropy_count; + int entropy_count; /* Must at no time exceed ->POOLBITS! */ int input_rotate; }; _
| |