Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jan 2001 19:06:44 -0800
From:      Kris Kennaway <kris@freebsd.org>
To:        Garrett Wollman <wollman@hergotha.lcs.mit.edu>
Cc:        current@freebsd.org, markm@freebsd.org
Subject:   Re: mount_mfs "fix" for entropy hang
Message-ID:  <20010114190644.C15423@citusc.usc.edu>
In-Reply-To: <200101120007.f0C07ib14316@hergotha.lcs.mit.edu>; from wollman@hergotha.lcs.mit.edu on Thu, Jan 11, 2001 at 07:07:44PM -0500
References:  <200101120007.f0C07ib14316@hergotha.lcs.mit.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--eHhjakXzOLJAF9wJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I wonder if a better approach might be to make /dev/random return 0
bytes when unseeded, instead of blocking. Then srandomdev() would
automatically back down to seeding internally, for example, and no
other code changes in mount_mfs would be needed.

A warning could be emitted in this case for diagnostic purposes
(e.g. in case something actually needs cryptographic randomness and
isn't getting it because it's running too early) - this should be the
only case when /dev/random returns 0 bytes on a read.

Kris

On Thu, Jan 11, 2001 at 07:07:44PM -0500, Garrett Wollman wrote:
> Index: mkfs.c
> ===================================================================
> RCS file: /home/ncvs/src/sbin/newfs/mkfs.c,v
> retrieving revision 1.32
> diff -u -r1.32 mkfs.c
> --- mkfs.c	2000/10/24 03:28:59	1.32
> +++ mkfs.c	2001/01/12 00:05:59
> @@ -192,7 +192,13 @@
>  #ifdef FSIRAND
>  	if (!randinit) {
>  		randinit = 1;
> -		srandomdev();
> +		if (mfs) {
> +			time_t t;
> +			time(&t);
> +			srandom(t);
> +		} else {
> +			srandomdev();
> +		}
>  	}
>  #endif
>  	if (mfs) {

--eHhjakXzOLJAF9wJ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6YmlEWry0BWjoQKURAnE3AKDrbTDmcwqFiJIAfA095q86JcFj1ACeNdbR
C9HOHVt63yKQI3MlVE2Frr4=
=Ulni
-----END PGP SIGNATURE-----

--eHhjakXzOLJAF9wJ--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010114190644.C15423>