Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/bpf: Fix gotol with large offsets

The gotol implementation uses a wrong data type for the offset: it
should be s32, not s16.

Fixes: c690191e23d8 ("s390/bpf: Implement unconditional jump with 32-bit offset")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/r/20240102193531.3169422-2-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Ilya Leoshkevich and committed by
Alexei Starovoitov
ecba66cb 98e20e5e

+1 -1
+1 -1
arch/s390/net/bpf_jit_comp.c
··· 779 779 int i, bool extra_pass, u32 stack_depth) 780 780 { 781 781 struct bpf_insn *insn = &fp->insnsi[i]; 782 - s16 branch_oc_off = insn->off; 782 + s32 branch_oc_off = insn->off; 783 783 u32 dst_reg = insn->dst_reg; 784 784 u32 src_reg = insn->src_reg; 785 785 int last, insn_count = 1;