random: re-add removed comment about get_random_{u32,u64} reseeding
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 23 Mar 2022 04:21:52 +0000 (22:21 -0600)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 25 Mar 2022 14:49:40 +0000 (08:49 -0600)
The comment about get_random_{u32,u64}() not invoking reseeding got
added in an unrelated commit, that then was recently reverted by
0313bc278dac ("Revert "random: block in /dev/urandom""). So this adds
that little comment snippet back, and improves the wording a bit too.

Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c

index 1d7aac2a9600c42f0e9ae881a001cef20fa2495a..40107f8b9e9ead0d31818b2053bc196fde7f8bbb 100644 (file)
@@ -224,9 +224,10 @@ static void _warn_unseeded_randomness(const char *func_name, void *caller, void
  *
  * These interfaces will return the requested number of random bytes
  * into the given buffer or as a return value. This is equivalent to
- * a read from /dev/urandom. The integer family of functions may be
- * higher performance for one-off random integers, because they do a
- * bit of buffering.
+ * a read from /dev/urandom. The u32, u64, int, and long family of
+ * functions may be higher performance for one-off random integers,
+ * because they do a bit of buffering and do not invoke reseeding
+ * until the buffer is emptied.
  *
  *********************************************************************/