Module Name:    src
Committed By:   njoly
Date:           Sun Feb 23 12:01:51 UTC 2014

Modified Files:
        src/sys/compat/linux/arch/amd64: linux_exec_machdep.c

Log Message:
Use cprng_strong32 for LINUX_AT_RANDOM on amd64 too.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 \
    src/sys/compat/linux/arch/amd64/linux_exec_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/linux/arch/amd64/linux_exec_machdep.c
diff -u src/sys/compat/linux/arch/amd64/linux_exec_machdep.c:1.21 src/sys/compat/linux/arch/amd64/linux_exec_machdep.c:1.22
--- src/sys/compat/linux/arch/amd64/linux_exec_machdep.c:1.21	Fri Feb 21 07:53:53 2014
+++ src/sys/compat/linux/arch/amd64/linux_exec_machdep.c	Sun Feb 23 12:01:51 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_exec_machdep.c,v 1.21 2014/02/21 07:53:53 maxv Exp $ */
+/*	$NetBSD: linux_exec_machdep.c,v 1.22 2014/02/23 12:01:51 njoly Exp $ */
 
 /*-
  * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_exec_machdep.c,v 1.21 2014/02/21 07:53:53 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_exec_machdep.c,v 1.22 2014/02/23 12:01:51 njoly Exp $");
 
 #define ELFSIZE 64
 
@@ -49,6 +49,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_exec_m
 #include <sys/exec.h>
 #include <sys/stat.h>
 #include <sys/kauth.h>
+#include <sys/cprng.h>
 
 #include <sys/cpu.h>
 #include <machine/vmparam.h>
@@ -225,10 +226,10 @@ ELFNAME2(linux,copyargs)(struct lwp *l, 
 
 	esd.ai[i].a_type = LINUX_AT_RANDOM;
 	esd.ai[i++].a_v = (Elf_Addr)&esdp->randbytes[0];
-	esd.randbytes[0] = random();
-	esd.randbytes[1] = random();
-	esd.randbytes[2] = random();
-	esd.randbytes[3] = random();
+	esd.randbytes[0] = cprng_strong32();
+	esd.randbytes[1] = cprng_strong32();
+	esd.randbytes[2] = cprng_strong32();
+	esd.randbytes[3] = cprng_strong32();
 
 	esd.ai[i].a_type = AT_NULL;
 	esd.ai[i++].a_v = 0;

Reply via email to