]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
m68k: use fallback for random_get_entropy() instead of zero
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 8 Apr 2022 16:03:13 +0000 (18:03 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:23:08 +0000 (09:23 +0200)
commit16e0ff925035da70e9d8e5ef331953b80988c55c
tree6401fea041f8148b6436b631d18f4739e9548cc3
parenta8fe5bc3187ab0745d42b79d277d9805d9679606
m68k: use fallback for random_get_entropy() instead of zero

BugLink: https://bugs.launchpad.net/bugs/1981649
commit 0f392c95391f2d708b12971a07edaa7973f9eece upstream.

In the event that random_get_entropy() can't access a cycle counter or
similar, falling back to returning 0 is really not the best we can do.
Instead, at least calling random_get_entropy_fallback() would be
preferable, because that always needs to return _something_, even
falling back to jiffies eventually. It's not as though
random_get_entropy_fallback() is super high precision or guaranteed to
be entropic, but basically anything that's not zero all the time is
better than returning zero all the time.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/m68k/include/asm/timex.h