From sajd@telia.com  Tue Apr 13 07:55:59 2004
Return-Path: <sajd@telia.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8A2F816A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Apr 2004 07:55:59 -0700 (PDT)
Received: from av9-2-sn4.m-sp.skanova.net (av9-2-sn4.m-sp.skanova.net [81.228.10.107])
	by mx1.FreeBSD.org (Postfix) with ESMTP id F018643D54
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Apr 2004 07:55:58 -0700 (PDT)
	(envelope-from sajd@telia.com)
Received: by av9-2-sn4.m-sp.skanova.net (Postfix, from userid 502)
	id 63A1137E60; Tue, 13 Apr 2004 16:55:58 +0200 (CEST)
Received: from smtp2-2-sn4.m-sp.skanova.net (smtp2-2-sn4.m-sp.skanova.net [81.228.10.182])
	by av9-2-sn4.m-sp.skanova.net (Postfix) with ESMTP id 5500137E4F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Apr 2004 16:55:58 +0200 (CEST)
Received: from h204n2fls35o895.telia.com (h204n2fls35o895.telia.com [217.211.109.204])
	by smtp2-2-sn4.m-sp.skanova.net (Postfix) with ESMTP id 3519137E46
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Apr 2004 16:55:58 +0200 (CEST)
Received: from lucifer.sed1.root4.net (localhost [127.0.0.1])
	by h204n2fls35o895.telia.com (8.12.11/8.12.11) with ESMTP id i3DEtrDn002519
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 13 Apr 2004 16:55:53 +0200 (MEST)
	(envelope-from pawo002@lucifer.sed1.root4.net)
Received: (from root@localhost)
	by lucifer.sed1.root4.net (8.12.11/8.12.11/Submit) id i3DEtr43002518;
	Tue, 13 Apr 2004 16:55:53 +0200 (MEST)
	(envelope-from pawo002)
Message-Id: <200404131455.i3DEtr43002518@lucifer.sed1.root4.net>
Date: Tue, 13 Apr 2004 16:55:53 +0200 (MEST)
From: Pawel Worach <sajd@telia.com>
Reply-To: Pawel Worach <sajd@telia.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] no random entrophy breaks diskless boot
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         65489
>Category:       conf
>Synopsis:       [patch] no random entrophy breaks diskless boot
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    markm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Apr 13 08:00:38 PDT 2004
>Closed-Date:    Mon Mar 28 12:54:12 GMT 2005
>Last-Modified:  Mon Mar 28 12:54:12 GMT 2005
>Originator:     Pawel Worach
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Fri Apr 9 05:08:50 MEST 2004


>Description:
	newfs of the MFS /etc hangs in "block" state because /dev/random
        entrophy harvesting in not enabled. running initrandom before
        initdiskless fixes the problem. tested on i386.
>How-To-Repeat:
	boot a diskless client
>Fix:

	change rc order from:
initdiskless
rcconf.sh
initrandom
dumpon
...

        to:
initrandom
initdiskless
rcconf.sh
dumpon
...

--- patch begins here ---
Index: etc/rc.d/dumpon
===================================================================
RCS file: /export/ctm/cvs/src/etc/rc.d/dumpon,v
retrieving revision 1.3
diff -u -r1.3 dumpon
--- etc/rc.d/dumpon	8 Mar 2004 12:25:05 -0000	1.3
+++ etc/rc.d/dumpon	13 Apr 2004 14:43:42 -0000
@@ -4,7 +4,7 @@
 #
 
 # PROVIDE: dumpon
-# REQUIRE: initrandom
+# REQUIRE: rcconf
 # BEFORE: disks savecore
 # KEYWORD: FreeBSD nojail
 
Index: etc/rc.d/initdiskless
===================================================================
RCS file: /export/ctm/cvs/src/etc/rc.d/initdiskless,v
retrieving revision 1.33
diff -u -r1.33 initdiskless
--- etc/rc.d/initdiskless	31 Mar 2004 08:43:20 -0000	1.33
+++ etc/rc.d/initdiskless	13 Apr 2004 14:43:42 -0000
@@ -27,6 +27,7 @@
 # $FreeBSD: src/etc/rc.d/initdiskless,v 1.33 2004/03/31 08:43:20 luigi Exp $
 #
 # PROVIDE: initdiskless
+# REQUIRE: initrandom
 # KEYWORD: FreeBSD nojail
 
 
Index: etc/rc.d/initrandom
===================================================================
RCS file: /export/ctm/cvs/src/etc/rc.d/initrandom,v
retrieving revision 1.3
diff -u -r1.3 initrandom
--- etc/rc.d/initrandom	9 Apr 2004 15:56:16 -0000	1.3
+++ etc/rc.d/initrandom	13 Apr 2004 14:43:42 -0000
@@ -4,7 +4,6 @@
 #
 
 # PROVIDE: initrandom
-# REQUIRE: initdiskless
 # BEFORE: disks
 # KEYWORD: FreeBSD nojail
 
Index: etc/rc.d/rcconf.sh
===================================================================
RCS file: /export/ctm/cvs/src/etc/rc.d/rcconf.sh,v
retrieving revision 1.2
diff -u -r1.2 rcconf.sh
--- etc/rc.d/rcconf.sh	25 Jan 2003 20:02:35 -0000	1.2
+++ etc/rc.d/rcconf.sh	13 Apr 2004 14:43:42 -0000
@@ -5,7 +5,7 @@
 
 # PROVIDE: rcconf
 # REQUIRE: initdiskless
-# BEFORE:  disks initrandom
+# BEFORE:  disks
 # KEYWORD: FreeBSD
 
 . /etc/rc.subr
--- patch ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->markm 
Responsible-Changed-By: ru 
Responsible-Changed-When: Tue Apr 13 09:45:53 PDT 2004 
Responsible-Changed-Why:  
Assign to a responsible party. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=65489 

From: Brooks Davis <brooks@one-eyed-alien.net>
To: Pawel Worach <sajd@telia.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/65489: [patch] no random entrophy breaks diskless boot
Date: Tue, 13 Apr 2004 10:40:45 -0700

 On Tue, Apr 13, 2004 at 04:55:53PM +0200, Pawel Worach wrote:
 > 
 > >Number:         65489
 > >Category:       conf
 > >Synopsis:       [patch] no random entrophy breaks diskless boot
 > >Confidential:   no
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    freebsd-bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:       
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   current-users
 > >Arrival-Date:   Tue Apr 13 08:00:38 PDT 2004
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Pawel Worach
 > >Release:        FreeBSD 5.2-CURRENT i386
 > >Organization:
 > >Environment:
 > System: FreeBSD 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Fri Apr 9 05:08:50 MEST 2004
 > 
 > 
 > >Description:
 > 	newfs of the MFS /etc hangs in "block" state because /dev/random
 >         entrophy harvesting in not enabled. running initrandom before
 >         initdiskless fixes the problem. tested on i386.
 > >How-To-Repeat:
 > 	boot a diskless client
 > >Fix:
 > 
 > 	change rc order from:
 > initdiskless
 > rcconf.sh
 > initrandom
 > dumpon
 > ...
 > 
 >         to:
 > initrandom
 > initdiskless
 > rcconf.sh
 > dumpon
 > ...
 
 This patch is incorrect and potentialy dangerous. initrandom must not
 come before initdiskless because most of /etc may not exist until after
 initdiskless is called.  Instead, the portion of initrandom that seeds
 /dev/random with weak entropy to get things moving should be split out
 into a seperate script that runs before initdiskless.
 
 If I can get some agreement that this is the right approach, I'll be
 happy to do it.
 
 -- Brooks

From: Brooks Davis <brooks@one-eyed-alien.net>
To: Pawel Worach <sajd@telia.com>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/65489: [patch] no random entrophy breaks diskless boot
Date: Tue, 13 Apr 2004 11:19:14 -0700

 The following patch should do what I think should be done in this case.
 
 -- Brooks
 
 diff -ruN /usr/home/brooks/working/freebsd/p4/freebsd/etc/rc.d/initdiskless ./initdiskless
 --- /usr/home/brooks/working/freebsd/p4/freebsd/etc/rc.d/initdiskless	Fri Apr  9 14:08:43 2004
 +++ ./initdiskless	Tue Apr 13 11:12:12 2004
 @@ -26,6 +26,7 @@
  #
  # $FreeBSD: src/etc/rc.d/initdiskless,v 1.33 2004/03/31 08:43:20 luigi Exp $
  #
 +# REQUIRE: preseedrandom
  # PROVIDE: initdiskless
  # KEYWORD: FreeBSD nojail
  
 diff -ruN /usr/home/brooks/working/freebsd/p4/freebsd/etc/rc.d/initrandom ./initrandom
 --- /usr/home/brooks/working/freebsd/p4/freebsd/etc/rc.d/initrandom	Fri Apr  9 14:08:43 2004
 +++ ./initrandom	Tue Apr 13 11:11:33 2004
 @@ -50,14 +50,6 @@
  			fi
  		fi
  
 -		# XXX temporary until we can improve the entropy
 -		# harvesting rate.
 -		# Entropy below is not great, but better than nothing.
 -		# This unblocks the generator at startup
 -		( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww; ) \
 -		    | dd of=/dev/random bs=8k 2>/dev/null
 -		cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null
 -
  		# First pass at reseeding /dev/random.
  		#
  		case ${entropy_file} in
 diff -ruN /usr/home/brooks/working/freebsd/p4/freebsd/etc/rc.d/preseedrandom ./preseedrandom
 --- /usr/home/brooks/working/freebsd/p4/freebsd/etc/rc.d/preseedrandom	Wed Dec 31 16:00:00 1969
 +++ ./preseedrandom	Tue Apr 13 11:13:26 2004
 @@ -0,0 +1,15 @@
 +#!/bin/sh
 +#
 +# $FreeBSD$
 +#
 +
 +# PROVIDE: preseedrandom
 +# KEYWORD: FreeBSD nojail
 +
 +# XXX temporary until we can improve the entropy
 +# harvesting rate.
 +# Entropy below is not great, but better than nothing.
 +# This unblocks the generator at startup
 +( ps -fauxww; sysctl -a; date; df -ib; dmesg; ps -fauxww; ) \
 +    | dd of=/dev/random bs=8k 2>/dev/null
 +cat /bin/ls | dd of=/dev/random bs=8k 2>/dev/null

From: Pawel Worach <pawel_worach@yahoo.com>
To: Brooks Davis <brooks@one-eyed-alien.net>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: conf/65489: [patch] no random entrophy breaks diskless boot
Date: Tue, 13 Apr 2004 11:28:25 -0700 (PDT)

 --- Brooks Davis <brooks@one-eyed-alien.net> wrote:
 > The following patch should do what I think should be done in this
 > case.
 > 
 
 > +++ ./preseedrandom	Tue Apr 13 11:13:26 2004
 
 Looks just fine to me. Now we have three rc scripts
 to setup /dev/random :)
 
  - Pawel
 
 
 	
 		
 __________________________________
 Do you Yahoo!?
 Yahoo! Tax Center - File online by April 15th
 http://taxes.yahoo.com/filing.html
State-Changed-From-To: open->closed 
State-Changed-By: markm 
State-Changed-When: Mon Mar 28 12:53:21 GMT 2005 
State-Changed-Why:  
Secure startup of /dev/random committed and shipping. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=65489 
>Unformatted:
