On Mon, Oct 06, 2008 at 03:07:59PM -0700, Kees Cook wrote:
random32() is not a cryptographically strong RNG. I suspect it would
be pretty easy to reverse engineer its seed given some state. It hasn't
been designed to be protected against that.
While I suspect this wouldn't be a serious threat to the security
model for mmap (to break the mmap placement you would still need quite a lot of
addresses before you can predict some and I presume most apps do not leak
addresses) it would seem unnecessarily
weak to me because using a better algorithm is not very costly.
Also it might be a problem for some of the other potential users.
cryptographically strong RNGs are especially designed to make this
reverse engineering of the state hard.
Simple ones can be just a cryptographic hash + counter + secret or
the same with a encryption algorithm like AES, but there are
also algorithms who are especially designed for this like yarrow/fortuna
See
http://en.wikipedia.org/wiki/Cryptographically_secure_pseudo-random_number_generator
-Andi
--
ak@linux.intel.com
--