From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752477AbbBWKpd (ORCPT ); Mon, 23 Feb 2015 05:45:33 -0500 Received: from verein.lst.de ([213.95.11.211]:33219 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752075AbbBWKpc (ORCPT ); Mon, 23 Feb 2015 05:45:32 -0500 Date: Mon, 23 Feb 2015 11:45:27 +0100 From: Torsten Duwe To: "Theodore Ts'o" Cc: "H. Peter Anvin" , lkml Subject: [RESEND][PATCH] Fix add_timer_randomness throttling Message-ID: <20150223104527.GA23345@lst.de> References: <20150204140029.GA2949@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150204140029.GA2949@lst.de> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [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. Signed-off-by: Torsten Duwe @@ -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;