linux/arch/loongarch
Hengqi Chen 0d666db731 LoongArch: BPF: Sign extend kfunc call arguments
commit 3f5a238f24 upstream.

The kfunc calls are native calls so they should follow LoongArch calling
conventions. Sign extend its arguments properly to avoid kernel panic.
This is done by adding a new emit_abi_ext() helper. The emit_abi_ext()
helper performs extension in place meaning a value already store in the
target register (Note: this is different from the existing sign_extend()
helper and thus we can't reuse it).

Cc: stable@vger.kernel.org
Fixes: 5dc615520c ("LoongArch: Add BPF JIT support")
Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-08 10:14:51 +01:00
..
boot LoongArch: Fix GMAC's phy-mode definitions in dts 2024-06-03 15:45:53 +08:00
configs mm: z3fold: deprecate CONFIG_Z3FOLD 2024-09-17 01:07:00 -07:00
crypto move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
include LoongArch: Use __pmd()/__pte() for swap entry conversions 2026-01-08 10:14:47 +01:00
kernel LoongArch: Refactor register restoration in ftrace_common_return 2026-01-08 10:14:51 +01:00
kvm LoongArch: KVM: Add delay until timer interrupt injected 2025-11-24 10:35:58 +01:00
lib LoongArch: csum: Fix OoB access in IP checksum code for negative lengths 2025-02-21 14:01:17 +01:00
mm LoongArch: Fix panic caused by NULL-PMD in huge_pte_offset() 2025-06-27 11:11:37 +01:00
net LoongArch: BPF: Sign extend kfunc call arguments 2026-01-08 10:14:51 +01:00
pci LoongArch: Add new PCI ID for pci_fixup_vgadev() 2026-01-08 10:14:46 +01:00
power LoongArch: Save and restore CSR.CNTC for hibernation 2025-05-22 14:29:44 +02:00
vdso LoongArch: vDSO: Remove -nostdlib complier flag 2025-09-09 18:58:05 +02:00
Kbuild LoongArch: Allow device trees be built into the kernel 2024-01-17 12:43:00 +08:00
Kconfig LoongArch: Update help info of ARCH_STRICT_ALIGN 2025-09-25 11:13:45 +02:00
Kconfig.debug LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub 2024-06-21 10:18:40 +08:00
Makefile LoongArch: Add cflag -fno-isolate-erroneous-paths-dereference 2025-10-19 16:33:39 +02:00