Skip to contentSkip to conversation

Fix add_timer_randomness throttling

PATCH RESEND New Torsten Duwe 1 participant 2 messages Feb 4, 2015 – Feb 23, 2015

lore
Share & tools
lore
#0 lore raw

Hi Ted,

review of a backport of a283b5c459784f97 suggests to me that it has one replacement too much: in add_timer_randomness, entropy_count is compared to trickle_thresh, which are _both_ scaled up by ENTROPY_SHIFT. I'd therefore revert that hunk.

@@ -674,7 +697,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)

preempt_disable();
/* if over the trickle threshold, use only 1 in 4096 samples */
- if (ENTROPY_BITS(&input_pool) > trickle_thresh &&
+ if (input_pool.entropy_count > trickle_thresh &&
((__this_cpu_inc_return(trickle_count) - 1) & 0xfff))
goto out;

#1 lore raw

PATCH RESEND 1/1 Fix add_timer_randomness throttling

[now with "PATCH" tag]

It looks to me that commit a283b5c459784f97 has one replacement too much:
in add_timer_randomness, entropy_count is compared to trickle_thresh, which are _both_ scaled up by ENTROPY_SHIFT. I'd therefore revert that hunk.

@@ -674,7 +697,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)

preempt_disable();
/* if over the trickle threshold, use only 1 in 4096 samples */
- if (ENTROPY_BITS(&input_pool) > trickle_thresh &&
+ if (input_pool.entropy_count > trickle_thresh &&
((__this_cpu_inc_return(trickle_count) - 1) & 0xfff))
goto out;