]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
LoongArch: BPF: Zero-extend bpf_tail_call() index
authorHengqi Chen <hengqi.chen@gmail.com>
Wed, 31 Dec 2025 07:19:20 +0000 (15:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:14:51 +0000 (10:14 +0100)
commitfcaafcc27ba5b327065a3b025fe3587613f12f11
tree527772dcb8349bbf68d2fb4399ee8b7d18db8036
parentbb92a3af3ce58c6d107e1e85837bde2e6f0833bc
LoongArch: BPF: Zero-extend bpf_tail_call() index

commit eb71f5c433e1c6dff089b315881dec40a88a7baf upstream.

The bpf_tail_call() index should be treated as a u32 value. Let's
zero-extend it to avoid calling wrong BPF progs. See similar fixes
for x86 [1]) and arm64 ([2]) for more details.

  [1]: https://github.com/torvalds/linux/commit/90caccdd8cc0215705f18b92771b449b01e2474a
  [2]: https://github.com/torvalds/linux/commit/16338a9b3ac30740d49f5dfed81bac0ffa53b9c7

Cc: stable@vger.kernel.org
Fixes: 5dc615520c4d ("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>
arch/loongarch/net/bpf_jit.c