diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-01-19 12:45:37 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2014-01-19 12:45:37 +0000 |
commit | 28cc8c738305152ba1636b91a1fc01ed7bcc4d40 (patch) | |
tree | 667da0156500e5484c9dc2c21d8068352afa40fd /sys/arch/alpha | |
parent | a69dcedd6829f0cd8f3dd427ebba96d41ed91e35 (diff) |
Initialize ci_randseed better using arc4random() + a trick. Remove the
libkern srandom() API since it is not suitable for this use.
ok kettenis miod
Diffstat (limited to 'sys/arch/alpha')
-rw-r--r-- | sys/arch/alpha/alpha/cpu.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/alpha/alpha/cpu.c b/sys/arch/alpha/alpha/cpu.c index 47ca2118cd5..83e18399061 100644 --- a/sys/arch/alpha/alpha/cpu.c +++ b/sys/arch/alpha/alpha/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.30 2013/12/22 18:53:14 miod Exp $ */ +/* $OpenBSD: cpu.c,v 1.31 2014/01/19 12:45:35 deraadt Exp $ */ /* $NetBSD: cpu.c,v 1.44 2000/05/23 05:12:53 thorpej Exp $ */ /*- @@ -64,6 +64,7 @@ #include <sys/device.h> #include <sys/proc.h> #include <sys/user.h> +#include <dev/rndvar.h> #include <uvm/uvm_extern.h> @@ -399,7 +400,7 @@ cpu_boot_secondary_processors() continue; if (ci->ci_flags & CPUF_PRIMARY) continue; - ci->ci_randseed = random(); + ci->ci_randseed = (arc4random() & 0x7fffffff) + 1; /* This processor is all set up; boot it! */ cpu_boot_secondary(ci); |