[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080829125445.9e48b1f1.akpm@linux-foundation.org>
Date: Fri, 29 Aug 2008 12:54:45 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: aaron@...finllc.com, mpm@...enic.com, linux-kernel@...r.kernel.org,
tytso@....edu, stable@...nel.org
Subject: Re: drivers/char/random.c line 728 BUG
On Fri, 29 Aug 2008 12:48:07 -0700
Andrew Morton <akpm@...ux-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;
};
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists