• Ard Biesheuvel's avatar
    ARM: backtrace-clang: avoid crash on bogus frame pointer · eae9523f
    Ard Biesheuvel authored
    
    
    The Clang backtrace code dereferences the link register value pulled
    from the stack to decide whether the caller was a branch-and-link
    instruction, in order to subsequently decode the offset to find the
    start of the calling function. Unlike other loads in this routine, this
    one is not protected by a fixup, and may therefore cause a crash if the
    address in question is bogus.
    
    So let's fix this, by treating the fault as a failure to decode the 'bl'
    instruction. To avoid a label renum, reuse a fixup label that guards an
    instruction that cannot fault to begin with.
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
    Tested-by: default avatarMarc Zyngier <maz@kernel.org>
    Tested-by: Vladimir Murzin <vladimir.murzin@arm.com> # ARMv7M
    eae9523f
backtrace-clang.S 6.84 KB