]> Git Repo - J-linux.git/commitdiff
riscv: bpf: Fix eBPF's exception tables
authorJisheng Zhang <[email protected]>
Mon, 10 Jan 2022 16:52:08 +0000 (00:52 +0800)
committerPalmer Dabbelt <[email protected]>
Wed, 19 Jan 2022 18:50:02 +0000 (10:50 -0800)
eBPF's exception tables needs to be modified to relative synchronously.

Suggested-by: Tong Tiangen <[email protected]>
Signed-off-by: Jisheng Zhang <[email protected]>
Fixes: 1f77ed9422cb ("riscv: switch to relative extable and other improvements")
Signed-off-by: Palmer Dabbelt <[email protected]>
arch/riscv/net/bpf_jit_comp64.c

index 293dd6e171ed5eaa90a38df426ccd09486e61119..0bcda99d1d682ebc0abb616c731e2c5964566585 100644 (file)
@@ -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
This page took 0.05468 seconds and 4 git commands to generate.