Date: Sat, 1 Nov 2014 22:34:49 -0700 From: Adrian Chadd <adrian@freebsd.org> To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= <des@freebsd.org> Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org> Subject: Re: svn commit: r273958 - head/sys/dev/random Message-ID: <CAJ-Vmo=ZCeSxZVFYV-B%2BPQQm7DLOZLzEYc9rNeh50ty_WS2R1A@mail.gmail.com> In-Reply-To: <201411020201.sA221unt091493@svn.freebsd.org> References: <201411020201.sA221unt091493@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Woo, this fixed the embedded boot! Thanks! -adrian On 1 November 2014 19:01, Dag-Erling Sm=C3=B8rgrav <des@freebsd.org> 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 >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=ZCeSxZVFYV-B%2BPQQm7DLOZLzEYc9rNeh50ty_WS2R1A>