random: deobfuscate irq u32/u64 contributions
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 10 Feb 2022 16:01:27 +0000 (17:01 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Wed, 16 Feb 2022 23:02:07 +0000 (00:02 +0100)
commit897d139345fb67d5e71847f1387d126029f3f53e
tree8c7347d0a3f4d50669e3a118eac39be486b3acb2
parent1bc6c6c18fd598e265df7e4d4f2843d6051a96fa
random: deobfuscate irq u32/u64 contributions

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>
drivers/char/random.c