From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A104C433EF for ; Fri, 11 Feb 2022 06:07:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237134AbiBKGHe (ORCPT ); Fri, 11 Feb 2022 01:07:34 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:51838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbiBKGHc (ORCPT ); Fri, 11 Feb 2022 01:07:32 -0500 Received: from isilmar-4.linta.de (isilmar-4.linta.de [136.243.71.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B732F10C1 for ; Thu, 10 Feb 2022 22:07:31 -0800 (PST) X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES Received: from owl.dominikbrodowski.net (owl.brodo.linta [10.2.0.111]) by isilmar-4.linta.de (Postfix) with ESMTPSA id 3001C2013A8; Fri, 11 Feb 2022 06:07:30 +0000 (UTC) Received: by owl.dominikbrodowski.net (Postfix, from userid 1000) id 7D85F8061A; Fri, 11 Feb 2022 06:57:03 +0100 (CET) Date: Fri, 11 Feb 2022 06:57:03 +0100 From: Dominik Brodowski To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, Theodore Ts'o Subject: Re: [PATCH v2] random: deobfuscate irq u32/u64 contributions Message-ID: References: <20220210171322.165122-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220210171322.165122-1-Jason@zx2c4.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Thu, Feb 10, 2022 at 06:13:22PM +0100 schrieb Jason A. Donenfeld: > In the irq handler, we fill out 16 bytes differently on 32-bit and > 64-bit platforms. Whether or not you like that, it is a matter of fact. > But it might not be a fact you well realized until now, because the code > that loaded the irq info into 4 32-bit words was quite confusing. > Instead, this commit makes everything explicit by having separate > (compile-time) branches for 32-bit and 64-bit machines. In the process, > we now easily see that we were truncating the contribution of > random_get_entropy() in mix_interrupt_randomness() which we rectify by > using the correct integer type. > > Cc: Theodore Ts'o > Cc: Dominik Brodowski > Signed-off-by: Jason A. Donenfeld Reviewed-by: Dominik Brodowski Thanks, Dominik