lkml.org 
[lkml]   [2001]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] random.c bugfix
Date
Hi,

there's a bug in random.c, I think. The third argument of
extract_entropy() is supposed to be the number of _bytes_ to extract,
while nwords contains the number of _bytes_ we want. This seems to lead
us to transfer n bytes of entropy and credit for n*4 bytes.

René



--- linux-2.4.14-pre2/drivers/char/random.c Fri Oct 26 23:07:16 2001
+++ linux-2.4.14-pre2-rs/drivers/char/random.c Sat Oct 27 05:36:23 2001
@@ -1253,7 +1253,7 @@
r == sec_random_state ? "secondary" : "unknown",
r->entropy_count, nbytes * 8);

- extract_entropy(random_state, tmp, nwords, 0);
+ extract_entropy(random_state, tmp, nwords * 4, 0);
add_entropy_words(r, tmp, nwords);
credit_entropy_store(r, nwords * 32);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:11    [W:0.057 / U:1.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site