Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/crypto/cprng_fast Access to struct cprng_fast must be co...
details: https://anonhg.NetBSD.org/src/rev/596bdf57b14a
branches: trunk
changeset: 331470:596bdf57b14a
user: riastradh <riastradh%NetBSD.org@localhost>
date: Mon Aug 11 13:01:58 2014 +0000
description:
Access to struct cprng_fast must be consistently at IPL_VM.
diffstat:
sys/crypto/cprng_fast/cprng_fast.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (33 lines):
diff -r f6a7fe227a6b -r 596bdf57b14a sys/crypto/cprng_fast/cprng_fast.c
--- a/sys/crypto/cprng_fast/cprng_fast.c Mon Aug 11 12:49:01 2014 +0000
+++ b/sys/crypto/cprng_fast/cprng_fast.c Mon Aug 11 13:01:58 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cprng_fast.c,v 1.6 2014/08/11 03:50:29 riastradh Exp $ */
+/* $NetBSD: cprng_fast.c,v 1.7 2014/08/11 13:01:58 riastradh Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cprng_fast.c,v 1.6 2014/08/11 03:50:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cprng_fast.c,v 1.7 2014/08/11 13:01:58 riastradh Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -269,11 +269,14 @@
{
struct cprng_fast *cprng;
uint8_t seed[CPRNG_FAST_SEED_BYTES];
+ int s;
cprng_strong(kern_cprng, seed, sizeof(seed), FASYNC);
cprng = percpu_getref(cprng_fast_percpu);
+ s = splvm();
cprng_fast_seed(cprng, seed);
+ splx(s);
percpu_putref(cprng_fast_percpu);
explicit_memset(seed, 0, sizeof(seed));
Home |
Main Index |
Thread Index |
Old Index