[lkml]   [2020]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    Patch in this message
    Subject[PATCH 4.9 002/271] powerpc/archrandom: fix arch_get_random_seed_int()
    From: Ard Biesheuvel <>

    commit b6afd1234cf93aa0d71b4be4788c47534905f0be upstream.

    Commit 01c9348c7620ec65

    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: 01c9348c7620ec65 ("powerpc: Use hardware RNG for arch_get_random_seed_* not arch_get_random_*")
    Signed-off-by: Ard Biesheuvel <>
    Signed-off-by: Michael Ellerman <>
    Signed-off-by: Greg Kroah-Hartman <>

    arch/powerpc/include/asm/archrandom.h | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/arch/powerpc/include/asm/archrandom.h
    +++ b/arch/powerpc/include/asm/archrandom.h
    @@ -27,7 +27,7 @@ static inline int arch_get_random_seed_i
    unsigned long val;
    int rc;

    - rc = arch_get_random_long(&val);
    + rc = arch_get_random_seed_long(&val);
    if (rc)
    *v = val;

     \ /
      Last update: 2020-01-28 15:16    [W:2.200 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site