Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux/arch/amd64 Use cprng_strong32 for LINUX_AT_...



details:   https://anonhg.NetBSD.org/src/rev/8d43e2d4a45f
branches:  trunk
changeset: 326950:8d43e2d4a45f
user:      njoly <njoly%NetBSD.org@localhost>
date:      Sun Feb 23 12:01:51 2014 +0000

description:
Use cprng_strong32 for LINUX_AT_RANDOM on amd64 too.

diffstat:

 sys/compat/linux/arch/amd64/linux_exec_machdep.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (41 lines):

diff -r 4df5a8baa9a3 -r 8d43e2d4a45f sys/compat/linux/arch/amd64/linux_exec_machdep.c
--- a/sys/compat/linux/arch/amd64/linux_exec_machdep.c  Sun Feb 23 11:09:42 2014 +0000
+++ b/sys/compat/linux/arch/amd64/linux_exec_machdep.c  Sun Feb 23 12:01:51 2014 +0000
@@ -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 @@
 #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 @@
 
        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;



Home | Main Index | Thread Index | Old Index