Module Name: src
Committed By: riastradh
Date: Tue Aug 27 11:55:16 UTC 2024
Modified Files:
src/lib/libc/gen: arc4random.3
Log Message:
arc4random(3): Note that arc4random respects kern.entropy.epoch.
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.21 -r1.22 src/lib/libc/gen/arc4random.3
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/gen/arc4random.3
diff -u src/lib/libc/gen/arc4random.3:1.21 src/lib/libc/gen/arc4random.3:1.22
--- src/lib/libc/gen/arc4random.3:1.21 Fri Jul 15 21:19:19 2016
+++ src/lib/libc/gen/arc4random.3 Tue Aug 27 11:55:16 2024
@@ -1,4 +1,4 @@
-.\" $NetBSD: arc4random.3,v 1.21 2016/07/15 21:19:19 wiz Exp $
+.\" $NetBSD: arc4random.3,v 1.22 2024/08/27 11:55:16 riastradh Exp $
.\"
.\" Copyright (c) 2014 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -233,6 +233,15 @@ and
.Fn arc4random_addrandom
may abort the process in the highly unlikely event that the operating
system fails to provide entropy.
+.Pp
+If
+.Nm
+detects that the sysctl variable
+.Li kern.entropy.epoch
+.Pq see Xr rnd 4
+has changed since its last output, it reseeds itself with additional
+data from the system entropy pool again before generating its next
+output.
.Sh SEE ALSO
.Xr rand 3 ,
.Xr random 3 ,
@@ -252,7 +261,7 @@ for testing purposes.
.Pp
The name
.Sq arc4random
-was chosen for hysterical raisins -- it was originally implemented
+was chosen for hysterical raisins \(em it was originally implemented
using the RC4 stream cipher, which has been known since shortly after
it was published in 1994 to have observable biases in the output, and
is now known to be broken badly enough to admit practical attacks in