]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
LoongArch: BPF: Save return address register ra to t0 before trampoline
authorChenghao Duan <duanchenghao@kylinos.cn>
Wed, 31 Dec 2025 07:19:20 +0000 (15:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:17:13 +0000 (10:17 +0100)
commit8b3c00c060187dccd9961877ba328cd969522dba
tree09c5fb4fdd7d813c81a9cfc900305c8943bde47c
parent321993a874f571a94b5a596f1132f798c663b56e
LoongArch: BPF: Save return address register ra to t0 before trampoline

commit d314e1f48260cef3f869e3edc02a02c8a48b08e1 upstream.

Modify the build_prologue() function to ensure the return address
register ra is saved to t0 before entering trampoline operations.
This change ensures the accurate return address handling when a BPF
program calls another BPF program, preventing errors in the BPF-to-BPF
call chain.

Cc: stable@vger.kernel.org
Fixes: 677e6123e3d2 ("LoongArch: BPF: Disable trampoline for kernel module function trace")
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/loongarch/net/bpf_jit.c