Source-Changes-HG archive

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

[src/trunk]: src/sys/kern entropy(9): Request entropy after the softint is en...



details:   https://anonhg.NetBSD.org/src/rev/46fdf1460c49
branches:  trunk
changeset: 363955:46fdf1460c49
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Mar 18 23:35:07 2022 +0000

description:
entropy(9): Request entropy after the softint is enabled.

Otherwise, there is a window during which interrupts are running, but
the softint is not, so if many interrupts queue (low-entropy) samples
early at boot, they might get dropped on the floor.  This could
happen, for instance, with a PCI RNG like ubsec(4) or hifn(4) which
requests entropy and processes it in its own hard interrupt handler.

diffstat:

 sys/kern/kern_entropy.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r b18db24fe436 -r 46fdf1460c49 sys/kern/kern_entropy.c
--- a/sys/kern/kern_entropy.c   Fri Mar 18 23:34:56 2022 +0000
+++ b/sys/kern/kern_entropy.c   Fri Mar 18 23:35:07 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_entropy.c,v 1.37 2022/03/18 23:34:56 riastradh Exp $      */
+/*     $NetBSD: kern_entropy.c,v 1.38 2022/03/18 23:35:07 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.37 2022/03/18 23:34:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.38 2022/03/18 23:35:07 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -2431,6 +2431,7 @@
 {
 
        entropy_init_late();
+       entropy_bootrequest();
 }
 
 int



Home | Main Index | Thread Index | Old Index