random: round-robin registers as ulong, not u32
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 22 Feb 2022 12:46:10 +0000 (13:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 30 May 2022 07:29:09 +0000 (09:29 +0200)
commite400ba11a241386dc27e57c35c00f61dce92e2f4
tree3f44900f1dfc512a807a246d54889b4ecf50c3b4
parent144c1e7ecf00688ae8c7f9a8483820527505a9d7
random: round-robin registers as ulong, not u32

commit da3951ebdcd1cb1d5c750e08cd05aee7b0c04d9a upstream.

When the interrupt handler does not have a valid cycle counter, it calls
get_reg() to read a register from the irq stack, in round-robin.
Currently it does this assuming that registers are 32-bit. This is
_probably_ the case, and probably all platforms without cycle counters
are in fact 32-bit platforms. But maybe not, and either way, it's not
quite correct. This commit fixes that to deal with `unsigned long`
rather than `u32`.

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