From 215ac718068a5e6371b91cc6baca0f648b336df3 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sun, 19 Jan 2014 13:12:08 +0000 Subject: oops, forgotten part Initialize ci_randseed better using arc4random() + a trick. Remove the libkern srandom() API since it is not suitable for this use. ok kettenis miod --- sys/kern/init_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index aa19b48cebd..254729598b1 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init_main.c,v 1.199 2014/01/19 00:39:40 deraadt Exp $ */ +/* $OpenBSD: init_main.c,v 1.200 2014/01/19 13:12:07 deraadt Exp $ */ /* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */ /* @@ -337,7 +337,7 @@ main(void *framep) sched_init_runqueues(); sleep_queue_init(); sched_init_cpu(curcpu()); - srandom(arc4random()); + p->p_curcpu->ci_randseed = (arc4random() & 0x7fffffff) + 1; /* Initialize work queues */ workq_init(); -- cgit v1.2.3