svn commit: r238118 - head/lib/libc/gen

Andrey Chernov ache at FreeBSD.ORG
Thu Jul 5 23:19:17 UTC 2012


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 does not 
> > use Giant:
> 
> 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:
> 
> 	# dd if=/dev/random of=/dev/null bs=1m count=1024
> 
> 	# sh -c 'for i in `jot $(sysctl -n hw.ncpu)`; do dd if=/dev/random of=/dev/null bs=1m count=128 & done'

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

-- 
http://ache.vniz.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-all/attachments/20120705/e8901b33/attachment.pgp


More information about the svn-src-all mailing list