From: Dominik Brodowski <linux@dominikbrodowski.net>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] random: re-add removed comment about get_random_{u32,u64} reseeding
Date: Wed, 23 Mar 2022 20:24:49 +0100 [thread overview]
Message-ID: <Yjt0AX8st/gE00CM@owl.dominikbrodowski.net> (raw)
In-Reply-To: <20220323042336.148775-1-Jason@zx2c4.com>
Am Tue, Mar 22, 2022 at 10:23:36PM -0600 schrieb Jason A. Donenfeld:
> The comment about get_random_{u32,u64}() not invoking reseeding got
> added in an unrelated commit, that then was recently reverted. So this
> adds that little comment snippet back.
>
> Cc: Dominik Brodowski <linux@dominikbrodowski.net>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
> drivers/char/random.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/random.c b/drivers/char/random.c
> index 1d7aac2a9600..82e37d7dd9f1 100644
> --- a/drivers/char/random.c
> +++ b/drivers/char/random.c
> @@ -226,7 +226,7 @@ static void _warn_unseeded_randomness(const char *func_name, void *caller, void
> * 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.
> + * bit of buffering and do not invoke reseeding.
> *
> *********************************************************************/
Actually, that seems wrong, as all these functions may call
_get_random_bytes(), which may invoke crng_make_state(), which
may invoke crng_reseed(). And it might be worthwhile to clarify
that it's only get_random_bytes() that does not do the bit of
buffering.
Thanks,
Dominik
next prev parent reply other threads:[~2022-03-23 19:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-23 4:23 Jason A. Donenfeld
2022-03-23 19:24 ` Dominik Brodowski [this message]
2022-03-23 19:45 ` Jason A. Donenfeld
2022-03-23 19:51 ` Dominik Brodowski
2022-03-23 20:10 ` [PATCH v2] " Jason A. Donenfeld
2022-03-24 5:10 ` Dominik Brodowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Yjt0AX8st/gE00CM@owl.dominikbrodowski.net \
--to=linux@dominikbrodowski.net \
--cc=Jason@zx2c4.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®