Module Name:    src
Committed By:   riastradh
Date:           Mon Aug 26 15:50:15 UTC 2024

Modified Files:
        src/sys/kern: kern_entropy.c

Log Message:
entropy(9): Allow unprivileged reads of sysctl kern.entropy.epoch.

Applications need this in order to know when to reseed.  (We should
also expose it through a page shared read-only with userland for
cheaper access, but until we do, let's let applications get at it
through sysctl.)

PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/sys/kern/kern_entropy.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/kern/kern_entropy.c
diff -u src/sys/kern/kern_entropy.c:1.70 src/sys/kern/kern_entropy.c:1.71
--- src/sys/kern/kern_entropy.c:1.70	Mon Aug 26 13:52:56 2024
+++ src/sys/kern/kern_entropy.c	Mon Aug 26 15:50:15 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_entropy.c,v 1.70 2024/08/26 13:52:56 riastradh Exp $	*/
+/*	$NetBSD: kern_entropy.c,v 1.71 2024/08/26 15:50:15 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.70 2024/08/26 13:52:56 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_entropy.c,v 1.71 2024/08/26 15:50:15 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/types.h>
@@ -400,7 +400,7 @@ entropy_init(void)
 	    SYSCTL_DESCR("Number of samples pending on CPUs"),
 	    NULL, 0, &E->samplespending, 0, CTL_CREATE, CTL_EOL);
 	sysctl_createv(&entropy_sysctllog, 0, &entropy_sysctlroot, NULL,
-	    CTLFLAG_PERMANENT|CTLFLAG_READONLY|CTLFLAG_PRIVATE, CTLTYPE_INT,
+	    CTLFLAG_PERMANENT|CTLFLAG_READONLY, CTLTYPE_INT,
 	    "epoch", SYSCTL_DESCR("Entropy epoch"),
 	    NULL, 0, &E->epoch, 0, CTL_CREATE, CTL_EOL);
 

Reply via email to