Module Name:    src
Committed By:   tsutsui
Date:           Sun Nov 27 00:09:04 UTC 2011

Modified Files:
        src/sys/lib/libkern: arc4random.c

Log Message:
Disable a DIAGNOSTIC test which causes kernel stack overflow on all arm ports.

Boot failure is reported from several arm users (nonaka@, ryo@, and others),
and too large auto variable in arc4_randrekey() is pointed out by enami@.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/lib/libkern/arc4random.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libkern/arc4random.c
diff -u src/sys/lib/libkern/arc4random.c:1.25 src/sys/lib/libkern/arc4random.c:1.26
--- src/sys/lib/libkern/arc4random.c:1.25	Sat Nov 26 14:04:20 2011
+++ src/sys/lib/libkern/arc4random.c	Sun Nov 27 00:09:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: arc4random.c,v 1.25 2011/11/26 14:04:20 enami Exp $	*/
+/*	$NetBSD: arc4random.c,v 1.26 2011/11/27 00:09:04 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2011 The NetBSD Foundation, Inc.
@@ -134,9 +134,11 @@ arc4_randrekey(void *arg)
 	int n, ask_for_more = 0;
 #ifdef _KERNEL
 #ifdef DIAGNOSTIC
+#if 0	/* XXX rngtest_t is too large and could cause stack overflow */
 	rngtest_t rt;
 #endif
 #endif
+#endif
 #if NRND > 0
 	static int callback_pending;
 	int r;
@@ -225,6 +227,7 @@ got_entropy:
 		arc4_numbytes = 0;
 #ifdef _KERNEL
 #ifdef DIAGNOSTIC
+#if 0	/* XXX rngtest_t is too large and could cause stack overflow */
 		/*
 		 * Perform the FIPS 140-2 statistical RNG test; warn if our
 		 * output has such poor quality as to fail the test.
@@ -239,6 +242,7 @@ got_entropy:
 		}
 #endif
 #endif
+#endif
 	}
 	if (__predict_true(arc4_initialized)) {
 		mutex_spin_exit(&arc4_mtx);

Reply via email to