Re: rework rndsink and cprng locking

Date: Mon, 17 Jun 2013 03:30:55 +0000
From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
The attached patch reworks the rndsink(9) abstraction to simplify it
and fix various races, and rework the implementation (but not the
crypto) of cprng(9) in the process. Comments?
Some discussion with rmind@ today revealed a (highly unlikely) race
that could cause a read from /dev/random to hang indefinitely even
though entropy is available. Attached is an updated patch that fixes
it by adding a hook for rndsink callbacks to use under their internal
locks to mark an rndsink ready for requeueing.