linux-stable/arch
Alexander Duyck 7a4c79329b bpf, arm64: Fix BTI type used for freplace attached functions
[ Upstream commit a3f25d614b ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-07-27 08:57:00 +02:00
..
alpha mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:12:39 +02:00
arc ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard 2023-07-19 16:36:19 +02:00
arm ARM: orion5x: fix d2net gpio initialization 2023-07-19 16:36:58 +02:00
arm64 bpf, arm64: Fix BTI type used for freplace attached functions 2023-07-27 08:57:00 +02:00
csky csky: fix up lock_mm_and_find_vma() conversion 2023-07-01 13:12:41 +02:00
hexagon mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:12:39 +02:00
ia64 ia64: mmap: Consider pgoff when searching for free mapping 2023-07-27 08:56:36 +02:00
loongarch LoongArch: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation 2023-07-19 16:37:00 +02:00
m68k mm: always expand the stack with the mmap write lock held 2023-07-01 13:12:40 +02:00
microblaze mm: always expand the stack with the mmap write lock held 2023-07-01 13:12:40 +02:00
mips MIPS: dec: prom: Address -Warray-bounds warning 2023-07-27 08:56:44 +02:00
nios2 mm/fault: convert remaining simple cases to lock_mm_and_find_vma() 2023-07-01 13:12:39 +02:00
openrisc openrisc: Union fpcsr and oldmask in sigcontext to unbreak userspace ABI 2023-07-23 13:53:45 +02:00
parisc io_uring: Fix io_uring mmap() by using architecture-provided get_unmapped_area() 2023-07-27 08:56:31 +02:00
powerpc powerpc/64s: Fix native_hpte_remove() to be irq-safe 2023-07-23 13:53:55 +02:00
riscv riscv: mm: fix truncation warning on RV32 2023-07-23 13:53:48 +02:00
s390 s390/decompressor: fix misaligned symbol build error 2023-07-23 13:54:08 +02:00
sh sh: hd64461: Handle virq offset for offchip IRQ base and HD64461 IRQ 2023-07-19 16:37:03 +02:00
sparc watchdog/hardlockup: rename some "NMI watchdog" constants/function 2023-07-19 16:35:32 +02:00
um um: Use HOST_DIR for mrproper 2023-07-19 16:36:53 +02:00
x86 x86/cpu/amd: Add a Zenbleed fix 2023-07-24 18:56:41 +02:00
xtensa xtensa: ISS: fix call to split_if_spec 2023-07-23 13:54:10 +02:00
.gitignore
Kconfig lazy tlb: shoot lazies, non-refcounting lazy tlb mm reference handling scheme 2023-03-28 16:20:08 -07:00