summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorderaadt <>2014-07-17 14:30:41 +0000
committerderaadt <>2014-07-17 14:30:41 +0000
commit4dd785c86387ee1f1a83ab5c2b77c235f8afcc04 (patch)
treef573d1bfb18ae2e48f8a5c44ca07100fcab330fc
parent5c7abf8ff6e24fab2498d8d7f938853552ab0b9c (diff)
downloadopenbsd-4dd785c86387ee1f1a83ab5c2b77c235f8afcc04.tar.gz
openbsd-4dd785c86387ee1f1a83ab5c2b77c235f8afcc04.tar.bz2
openbsd-4dd785c86387ee1f1a83ab5c2b77c235f8afcc04.zip
"Race-free because we're running single-threaded in a new
address space, and once allocated rs is never deallocated." document the forkhandler to save reviewers time, with matthew
-rw-r--r--src/lib/libc/crypt/arc4random.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libc/crypt/arc4random.c b/src/lib/libc/crypt/arc4random.c
index 3b7f34faed..565bfa0333 100644
--- a/src/lib/libc/crypt/arc4random.c
+++ b/src/lib/libc/crypt/arc4random.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: arc4random.c,v 1.45 2014/07/16 00:18:54 deraadt Exp $ */ 1/* $OpenBSD: arc4random.c,v 1.46 2014/07/17 14:30:41 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1996, David Mazieres <dm@uun.org> 4 * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -69,6 +69,10 @@ static inline void _rs_rekey(u_char *dat, size_t datlen);
69static inline void 69static inline void
70_rs_forkhandler(void) 70_rs_forkhandler(void)
71{ 71{
72 /*
73 * Race-free because we're running single-threaded in a new
74 * address space, and once allocated rs is never deallocated.
75 */
72 if (rs) 76 if (rs)
73 rs->rs_count = 0; 77 rs->rs_count = 0;
74} 78}