From: Jisheng Zhang Date: Mon, 10 Jan 2022 16:52:08 +0000 (+0800) Subject: riscv: bpf: Fix eBPF's exception tables X-Git-Tag: baikal/aarch64/sdk6.1~4813^2~13 X-Git-Url: https://git.baikalelectronics.ru/?a=commitdiff_plain;h=1de9c1620e8582e397ef540eab1171b273a3a3db;p=kernel.git riscv: bpf: Fix eBPF's exception tables eBPF's exception tables needs to be modified to relative synchronously. Suggested-by: Tong Tiangen Signed-off-by: Jisheng Zhang Fixes: 6f7fdd341429 ("riscv: switch to relative extable and other improvements") Signed-off-by: Palmer Dabbelt --- diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c index 293dd6e171ed5..0bcda99d1d682 100644 --- a/arch/riscv/net/bpf_jit_comp64.c +++ b/arch/riscv/net/bpf_jit_comp64.c @@ -497,7 +497,7 @@ static int add_exception_handler(const struct bpf_insn *insn, offset = pc - (long)&ex->insn; if (WARN_ON_ONCE(offset >= 0 || offset < INT_MIN)) return -ERANGE; - ex->insn = pc; + ex->insn = offset; /* * Since the extable follows the program, the fixup offset is always