summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJisheng Zhang <jszhang@kernel.org>2022-01-10 17:52:08 +0100
committerPalmer Dabbelt <palmer@rivosinc.com>2022-01-19 19:50:02 +0100
commitfc839c6d33c8828514f595822f457e51328507e5 (patch)
tree783d56bf40d5db37fc5a36a00407fa56c67ae67d /arch
parentriscv: mm: init: try best to remove #ifdef CONFIG_XIP_KERNEL usage (diff)
downloadlinux-fc839c6d33c8828514f595822f457e51328507e5.tar.xz
linux-fc839c6d33c8828514f595822f457e51328507e5.zip
riscv: bpf: Fix eBPF's exception tables
eBPF's exception tables needs to be modified to relative synchronously. Suggested-by: Tong Tiangen <tongtiangen@huawei.com> Signed-off-by: Jisheng Zhang <jszhang@kernel.org> Fixes: 1f77ed9422cb ("riscv: switch to relative extable and other improvements") Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv/net/bpf_jit_comp64.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/net/bpf_jit_comp64.c b/arch/riscv/net/bpf_jit_comp64.c
index 293dd6e171ed..0bcda99d1d68 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