Commit e1016978 authored by Ard Biesheuvel's avatar Ard Biesheuvel Committed by Kleber Sacilotto de Souza

powerpc/archrandom: fix arch_get_random_seed_int()

BugLink: https://bugs.launchpad.net/bugs/1864773

commit b6afd123 upstream.

Commit 01c9348c

  powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_*

updated arch_get_random_[int|long]() to be NOPs, and moved the hardware
RNG backing to arch_get_random_seed_[int|long]() instead. However, it
failed to take into account that arch_get_random_int() was implemented
in terms of arch_get_random_long(), and so we ended up with a version
of the former that is essentially a NOP as well.

Fix this by calling arch_get_random_seed_long() from
arch_get_random_seed_int() instead.

Fixes: 01c9348c ("powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_*")
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20191204115015.18015-1-ardb@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 30ba5714
......@@ -27,7 +27,7 @@ static inline int arch_get_random_seed_int(unsigned int *v)
unsigned long val;
int rc;
rc = arch_get_random_long(&val);
rc = arch_get_random_seed_long(&val);
if (rc)
*v = val;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment