Re: [PATCH v2] random: deobfuscate irq u32/u64 contributions

From: Dominik Brodowski
Date: Fri Feb 11 2022 - 01:07:35 EST


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 <tytso@xxxxxxx>
> Cc: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Jason A. Donenfeld <Jason@xxxxxxxxx>

Reviewed-by: Dominik Brodowski <linux@xxxxxxxxxxxxxxxxxxxx>

Thanks,
Dominik