Re: [PATCH] get_random_bytes returns the same on every boot

From: Andi Kleen
Date: Tue Jul 27 2004 - 12:45:19 EST


Balint Marton <cus@xxxxxxxxxx> writes:
> Therefore all random data will come from the secondary pool, and the
> kernel cannot reseed the secondary pool, because there is no real
> randomness in the primary one.
>
> The solution is simple: Initialize not just the primary, but also the
> secondary pool with the system time. My patch worked for me with
> 2.6.8-rc2, but it was not tested too long.

That still is an easily predictible value and may not even be
unique when lots of systems are powered up at the same time
(e.g. after a power failure)

It would be better to use the hardware random generators that
are available in some southbridges and some CPUs now. I did a patch
a long time ago to automatically seed random from the intel/amd
random driver. Maybe that would be a better solution here?

Also BTW your problem presents a strong case why compiling in
DHCP probes is bad and such stuff should run from initrd/initramfs.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/