Skip to contentSkip to conversation

/dev/urandom uses uninit bytes, leaks user data

PATCH Matti Linnanvuori 2 participants 2 messages Dec 15, 2007 Random number driver

lore
Share & tools
lore
#0 lore raw

From: Matti Linnanvuori <[email protected]>

/dev/urandom use no uninit bytes, leak no user data

---

drivers/char/random.c +1 -1
@@ -689,7 +689,7 @@ static ssize_t extract_entropy(struct en
  */
 static void xfer_secondary_pool(struct entropy_store *r, size_t nbytes)
 {
-	__u32 tmp[OUTPUT_POOL_WORDS];
+	static __u32 tmp[OUTPUT_POOL_WORDS];
 
 	if (r->pull && r->entropy_count < nbytes * 8 &&
 	    r->entropy_count < r->poolinfo->POOLBITS) {

Machen Sie Yahoo! zu Ihrer Startseite. Los geht's:
http://de.yahoo.com/set

#1 lore raw
Quoted 11 lines · Matti Linnanvuori

From: Matti Linnanvuori <[email protected]>

/dev/urandom use no uninit bytes, leak no user data

---

drivers/char/random.c static ssize_t extract_entropy(struct en · line 692

Quoted 5 lines
drivers/char/random.c +1 -1
@@ -689,7 +689,7 @@ static ssize_t extract_entropy(struct en
  */
 static void xfer_secondary_pool(struct entropy_store *r, size_t nbytes)
 {
-	__u32 tmp[OUTPUT_POOL_WORDS];
+	static __u32 tmp[OUTPUT_POOL_WORDS];

This looks like a race waiting to happen - what lock is held so we don't have 'tmp' smashed by 2 instances on different CPUs (not a problem when each instance lives on a hopefully separate stack)?