Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Jul 2012 03:19:04 +0400
From:      Andrey Chernov <ache@FreeBSD.ORG>
To:        Pawel Jakub Dawidek <pjd@FreeBSD.ORG>
Cc:        src-committers@FreeBSD.ORG, John Baldwin <jhb@FreeBSD.ORG>, svn-src-all@FreeBSD.ORG, David Chisnall <theraven@FreeBSD.ORG>, Attilio Rao <attilio@FreeBSD.ORG>, Konstantin Belousov <kostikbel@gmail.com>, svn-src-head@FreeBSD.ORG, markm@FreeBSD.ORG
Subject:   Re: svn commit: r238118 - head/lib/libc/gen
Message-ID:  <20120705231903.GA76664@vniz.net>
In-Reply-To: <20120705213901.GA1442@garage.freebsd.pl>
References:  <201207041951.q64JpPXu029310@svn.freebsd.org> <8344944B-1CEE-4CAD-96FB-EC5A743F6909@FreeBSD.org> <CAJ-FndAGgkgi5W3LqgMkeK9AquQ=1RhhYcj4jnLmuRg2EwVuqA@mail.gmail.com> <201207050749.43210.jhb@freebsd.org> <20120705213901.GA1442@garage.freebsd.pl>

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

--cWoXeonUoKmBZSoM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 05, 2012 at 11:39:02PM +0200, Pawel Jakub Dawidek wrote:
> > sysctls are not all Giant locked.   KERN_ARND is marked MPSAFE, so it d=
oes not=20
> > use Giant:
>=20
> It doesn't really matter. Our in-kernel random generator has its own
> giant lock, so is basically single threaded. Compare results of those
> two on some SMP machine:
>=20
> 	# dd if=3D/dev/random of=3D/dev/null bs=3D1m count=3D1024
>=20
> 	# sh -c 'for i in `jot $(sysctl -n hw.ncpu)`; do dd if=3D/dev/random of=
=3D/dev/null bs=3D1m count=3D128 & done'

It doesn't really matter for KERN_ARND because it is rarely reseeded and=20
consume most of its time on internal arc4 permutations. That is why strong=
=20
KERN_ARND seeding after boot is required (currently it is very weak and=20
easily guessed as I already mention) - started right after boot=20
applications all suffers from weak seeding up to the next rare KERN_ARND=20
and arc4random() both reseeds..

--=20
http://ache.vniz.net/

--cWoXeonUoKmBZSoM
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAk/2IOcACgkQVg5YK5ZEdN2XRgCgtyIYXuY50eyxAojhXAhdPI7x
te4AnA7zICkZ6S95V3wRl0nM9BubhrSO
=fHc7
-----END PGP SIGNATURE-----

--cWoXeonUoKmBZSoM--



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