From owner-svn-src-all@FreeBSD.ORG Sun Nov 2 05:34:52 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76E17AA; Sun, 2 Nov 2014 05:34:52 +0000 (UTC) Received: from mail-wi0-x229.google.com (mail-wi0-x229.google.com [IPv6:2a00:1450:400c:c05::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93742995; Sun, 2 Nov 2014 05:34:51 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id n3so3849707wiv.4 for ; Sat, 01 Nov 2014 22:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=LrvZWgR0eCfW1UplE10rUCa/ZmRqQPPA/Vmw0t60cXE=; b=EWRoHsrRs8Ivv56OwcMJvrOkut9khsEEQCPDhejSUQ1GaGYpG+wBSwzQ/+VlMnjfjZ zgIVkymtpnGXZDH/6Ty3qvVPl07cNg7DNN/lyMSvf4cug9jMqaApQ9NO+xZY55WzQFkA TvtWnresYQIaiVqit1t/hTiU2usbzVdBBmKCBLGBZx0sLUdmDCjvQS3c6hrbB0Q7Rcf7 atxFcPxWbmoYxVbEjNFfxTKuMVtC4n10zpeV/s19EECld9s+EcuoYDkY6B5dd1RSyGsx T6zjPgCZzvidt0EFukn2ggH+QAffz2iGgbia4zuHLJwyX8RNGMmsPf3H4eH0spH6HXT9 CmvQ== MIME-Version: 1.0 X-Received: by 10.194.192.161 with SMTP id hh1mr40135840wjc.72.1414906489510; Sat, 01 Nov 2014 22:34:49 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.106.136 with HTTP; Sat, 1 Nov 2014 22:34:49 -0700 (PDT) In-Reply-To: <201411020201.sA221unt091493@svn.freebsd.org> References: <201411020201.sA221unt091493@svn.freebsd.org> Date: Sat, 1 Nov 2014 22:34:49 -0700 X-Google-Sender-Auth: w2RfS-7fW4POC9c3g1HERkD4lUE Message-ID: Subject: Re: svn commit: r273958 - head/sys/dev/random From: Adrian Chadd To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Nov 2014 05:34:52 -0000 Woo, this fixed the embedded boot! Thanks! -adrian On 1 November 2014 19:01, Dag-Erling Sm=C3=B8rgrav wrote: > Author: des > Date: Sun Nov 2 02:01:55 2014 > New Revision: 273958 > URL: https://svnweb.freebsd.org/changeset/base/273958 > > Log: > Restore the auto-reseed logic, but move it to a much later point, > immediately before kick_init. > > Approved by: so (self) > > Modified: > head/sys/dev/random/random_adaptors.c > head/sys/dev/random/yarrow.c > > Modified: head/sys/dev/random/random_adaptors.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/random_adaptors.c Sun Nov 2 01:47:27 2014 = (r273957) > +++ head/sys/dev/random/random_adaptors.c Sun Nov 2 02:01:55 2014 = (r273958) > @@ -447,30 +447,8 @@ random_adaptors_deinit(void) > } > > /* > - * First seed. > - * > - * NB! NB! NB! > - * NB! NB! NB! > - * > - * It turns out this is bloody dangerous. I was fiddling with code elsew= here > - * and managed to get conditions where a safe (i.e. seeded) entropy devi= ce should > - * not have been possible. This managed to hide that by unblocking the d= evice anyway. > - * As crap randomness is not directly distinguishable from good randomne= ss, this > - * could have gone unnoticed for quite a while. > - * > - * NB! NB! NB! > - * NB! NB! NB! > - * > - * Very luckily, the probe-time entropy is very nearly good enough to ca= use a > - * first seed all of the time, and the default settings for other entrop= y > - * harvesting causes a proper, safe, first seed (unblock) in short order= after that. > - * > - * That said, the below would be useful where folks are more concerned w= ith > - * a quick start than with extra paranoia in a low-entropy environment. > - * > - * markm - October 2013. > + * Reseed the active adaptor shortly before starting init(8). > */ > -#ifdef RANDOM_AUTOSEED > /* ARGSUSED */ > static void > random_adaptors_seed(void *unused __unused) > @@ -484,6 +462,5 @@ random_adaptors_seed(void *unused __unus > > arc4rand(NULL, 0, 1); > } > -SYSINIT(random_seed, SI_SUB_INTRINSIC_POST, SI_ORDER_LAST, > - random_adaptors_reseed, NULL); > -#endif /* RANDOM_AUTOSEED */ > +SYSINIT(random_seed, SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, > + random_adaptors_seed, NULL); > > Modified: head/sys/dev/random/yarrow.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/dev/random/yarrow.c Sun Nov 2 01:47:27 2014 (= r273957) > +++ head/sys/dev/random/yarrow.c Sun Nov 2 02:01:55 2014 (= r273958) > @@ -508,7 +508,9 @@ void > random_yarrow_reseed(void) > { > > + mtx_lock(&random_reseed_mtx); > reseed(SLOW); > + mtx_unlock(&random_reseed_mtx); > } > > int >