Skip to content
Commit a3f25d61 authored by Alexander Duyck's avatar Alexander Duyck Committed by Alexei Starovoitov
Browse files

bpf, arm64: Fix BTI type used for freplace attached functions

When running an freplace attached bpf program on an arm64 system w were
seeing the following issue:
  Unhandled 64-bit el1h sync exception on CPU47, ESR 0x0000000036000003 -- BTI

After a bit of work to track it down I determined that what appeared to be
happening is that the 'bti c' at the start of the program was somehow being
reached after a 'br' instruction. Further digging pointed me toward the
fact that the function was attached via freplace. This in turn led me to
build_plt which I believe is invoking the long jump which is triggering
this error.

To resolve it we can replace the 'bti c' with 'bti jc' and add a comment
explaining why this has to be modified as such.

Fixes: b2ad54e1

 ("bpf, arm64: Implement bpf_arch_text_poke() for arm64")
Signed-off-by: default avatarAlexander Duyck <alexanderduyck@fb.com>
Acked-by: default avatarXu Kuohai <xukuohai@huawei.com>
Link: https://lore.kernel.org/r/168926677665.316237.9953845318337455525.stgit@ahduyck-xeon-server.home.arpa


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent a8237cc8
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