arm64: ftrace: don't validate branch via PLT in ftrace_make_nop()
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Tue, 6 Jun 2017 17:00:21 +0000 (17:00 +0000)
committerWill Deacon <will.deacon@arm.com>
Wed, 7 Jun 2017 10:50:34 +0000 (11:50 +0100)
commitf8af0b364e249eef0c71200826563947cd74267e
tree65449d594027a0f8ab6d019c935d97c454a7da1f
parentdbbb08f500d6146398b794fdc68a8e811366b451
arm64: ftrace: don't validate branch via PLT in ftrace_make_nop()

When turning branch instructions into NOPs, we attempt to validate the
action by comparing the old value at the call site with the opcode of
a direct relative branch instruction pointing at the old target.

However, these call sites are statically initialized to call _mcount(),
and may be redirected via a PLT entry if the module is loaded far away
from the kernel text, leading to false negatives and spurious errors.

So skip the validation if CONFIG_ARM64_MODULE_PLTS is configured.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/ftrace.c