linux-stable/arch
Alexander Duyck a3f25d614b 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: b2ad54e153 ("bpf, arm64: Implement bpf_arch_text_poke() for arm64")
Signed-off-by: Alexander Duyck <alexanderduyck@fb.com>
Acked-by: Xu Kuohai <xukuohai@huawei.com>
Link: https://lore.kernel.org/r/168926677665.316237.9953845318337455525.stgit@ahduyck-xeon-server.home.arpa
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-07-18 15:28:19 -07:00
..
alpha Merge branch 'expand-stack' 2023-06-28 20:35:21 -07:00
arc asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
arm asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
arm64 bpf, arm64: Fix BTI type used for freplace attached functions 2023-07-18 15:28:19 -07:00
csky arch/csky patches for 6.5 2023-07-01 21:12:32 -07:00
hexagon Merge branch 'expand-stack' 2023-06-28 20:35:21 -07:00
ia64 Kbuild updates for v6.5 2023-07-01 09:24:31 -07:00
loongarch asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
m68k asm-generic updates for 6.5 2023-07-06 10:06:04 -07:00
microblaze slab updates for 6.5 2023-06-29 16:34:12 -07:00
mips - fixes for KVM 2023-07-09 10:02:49 -07:00
nios2 slab updates for 6.5 2023-06-29 16:34:12 -07:00
openrisc OpenRISC fix for 6.5 2023-07-12 16:28:53 -07:00
parisc parisc: syscalls: Avoid compiler warnings with W=1 2023-07-03 18:56:03 +02:00
powerpc powerpc fixes for 6.5 #2 2023-07-07 10:00:30 -07:00
riscv Networking fixes for 6.5-rc2, including fixes from netfilter, 2023-07-13 14:21:22 -07:00
s390 s390 updates for 6.5 merge window part 2 2023-07-06 13:18:30 -07:00
sh sh fixes for v6.5 2023-07-13 13:34:00 -07:00
sparc drm fixes for 6.5-rc1 2023-07-06 22:42:54 -07:00
um Kbuild updates for v6.5 2023-07-01 09:24:31 -07:00
x86 Tracing fixes and clean ups: 2023-07-13 13:44:28 -07:00
xtensa powerpc updates for 6.5 2023-06-30 09:20:08 -07:00
.gitignore
Kconfig - Arnd Bergmann has fixed a bunch of -Wmissing-prototypes in 2023-06-28 10:59:38 -07:00