public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] random.c bugfix
@ 2001-10-27  4:21 René Scharfe
  2001-10-27  6:21 ` Andreas Dilger
  0 siblings, 1 reply; 15+ messages in thread
From: René Scharfe @ 2001-10-27  4:21 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Linus Torvalds, Alan Cox

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);
 	}


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2001-10-31 14:39 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-27  4:21 [PATCH] random.c bugfix René Scharfe
2001-10-27  6:21 ` Andreas Dilger
2001-10-27  6:35   ` Robert Love
2001-10-28 23:57   ` Horst von Brand
2001-10-29  5:37     ` Andreas Dilger
2001-10-29 16:15       ` Horst von Brand
2001-10-29 16:58         ` Oliver Xymoron
2001-10-29 23:39           ` Andreas Dilger
2001-10-30  0:23             ` Oliver Xymoron
2001-10-30  3:50               ` Andreas Dilger
2001-10-30 16:07                 ` Theodore Tso
2001-10-31  6:19                   ` Andreas Dilger
2001-10-31 14:42                     ` Oliver Xymoron
2001-10-30  4:49               ` Andreas Dilger
2001-10-29  5:46     ` [PATCH] MAJOR " Andreas Dilger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox