public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org
Subject: Re: [PATCH v2] random: avoid mis-detecting a slow counter as a cycle counter
Date: Fri, 22 Apr 2022 01:40:25 +0200	[thread overview]
Message-ID: <YmHraZcGnY3stnp9@zx2c4.com> (raw)
In-Reply-To: <20220421233152.58522-1-ebiggers@kernel.org>

Hi Eric,

Thanks. This looks better.

On Thu, Apr 21, 2022 at 04:31:52PM -0700, Eric Biggers wrote:
> Therefore, increase the number of counter comparisons from 1 to 3, to
> greatly reduce the rate of false positive cycle counter detections.
> +	for (i = 0; i < 3; i++) {
> +		unsigned long entropy = random_get_entropy();
 
Wondering: why do you do 3 comparisons rather than 2? What does 3 get
you that 2 doesn't already? I thought the only real requirement was that
in the event where (a)!=(b), (b) is read as meaningfully close as
possible to when the counter changes.

Jason

  reply	other threads:[~2022-04-21 23:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 23:31 [PATCH v2] random: avoid mis-detecting a slow counter as a cycle counter Eric Biggers
2022-04-21 23:40 ` Jason A. Donenfeld [this message]
2022-04-22  0:34   ` Eric Biggers
2022-04-22  9:42     ` Jason A. Donenfeld
2022-04-22 13:24       ` Jason A. Donenfeld

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=YmHraZcGnY3stnp9@zx2c4.com \
    --to=jason@zx2c4.com \
    --cc=ebiggers@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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