lkml.org 
[lkml]   [2022]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] random: avoid mis-detecting a slow counter as a cycle counter
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

\
 
 \ /
  Last update: 2022-04-22 01:41    [W:0.041 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site