lkml.org 
[lkml]   [2020]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.6 154/194] powerpc/vdso32: Fallback on getres syscall when clock is unknown
    Date
    From: Christophe Leroy <christophe.leroy@csgroup.eu>

    commit e963b7a28b2bf2416304e1a15df967fcf662aff5 upstream.

    There are other clocks than the standard ones, for instance
    per process clocks. Therefore, being above the last standard clock
    doesn't mean it is a bad clock. So, fallback to syscall instead
    of returning -EINVAL inconditionaly.

    Fixes: e33ffc956b08 ("powerpc/vdso32: implement clock_getres entirely")
    Cc: stable@vger.kernel.org # v5.6+
    Reported-by: Aurelien Jarno <aurelien@aurel32.net>
    Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
    Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
    Tested-by: Aurelien Jarno <aurelien@aurel32.net>
    Link: https://lore.kernel.org/r/7316a9e2c0c2517923eb4b0411c4a08d15e675a4.1589017281.git.christophe.leroy@csgroup.eu
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    arch/powerpc/kernel/vdso32/gettimeofday.S | 6 +++---
    1 file changed, 3 insertions(+), 3 deletions(-)

    --- a/arch/powerpc/kernel/vdso32/gettimeofday.S
    +++ b/arch/powerpc/kernel/vdso32/gettimeofday.S
    @@ -218,11 +218,11 @@ V_FUNCTION_BEGIN(__kernel_clock_getres)
    blr

    /*
    - * invalid clock
    + * syscall fallback
    */
    99:
    - li r3, EINVAL
    - crset so
    + li r0,__NR_clock_getres
    + sc
    blr
    .cfi_endproc
    V_FUNCTION_END(__kernel_clock_getres)

    \
     
     \ /
      Last update: 2020-05-18 20:06    [W:4.239 / U:0.928 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site