From a4e31d35a00d343cfc1ba16fac9ae1a5cea9d560 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Thu, 17 Jul 2014 14:30:41 +0000 Subject: [PATCH] "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 --- src/lib/libc/crypt/arc4random.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/libc/crypt/arc4random.c b/src/lib/libc/crypt/arc4random.c index 3b7f34fa..565bfa03 100644 --- a/src/lib/libc/crypt/arc4random.c +++ b/src/lib/libc/crypt/arc4random.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random.c,v 1.45 2014/07/16 00:18:54 deraadt Exp $ */ +/* $OpenBSD: arc4random.c,v 1.46 2014/07/17 14:30:41 deraadt Exp $ */ /* * Copyright (c) 1996, David Mazieres @@ -69,6 +69,10 @@ static inline void _rs_rekey(u_char *dat, size_t datlen); static inline void _rs_forkhandler(void) { + /* + * Race-free because we're running single-threaded in a new + * address space, and once allocated rs is never deallocated. + */ if (rs) rs->rs_count = 0; }