random: deobfuscate irq u32/u64 contributions
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 10 Feb 2022 16:01:27 +0000 (17:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 25 Jun 2022 09:46:34 +0000 (11:46 +0200)
commite0a5363f51f501731df3a3b69849f0c2b6fbf34e
treeff5a58634a2e6a6d6545698f1c8640db2350b3ea
parentfabaab48f24c7b9d3d5ae417d3f5ccccd28c8afa
random: deobfuscate irq u32/u64 contributions

commit b2f408fe403800c91a49f6589d95b6759ce1b30b upstream.

In the irq handler, we fill out 16 bytes differently on 32-bit and
64-bit platforms, and for 32-bit vs 64-bit cycle counters, which doesn't
always correspond with the bitness of the platform. Whether or not you
like this strangeness, 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 types.

Cc: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/random.c