Skip to content

Commit fc839c6

Browse files
xhackerustcpalmer-dabbelt
authored andcommitted
riscv: bpf: Fix eBPF's exception tables
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: 1f77ed9 ("riscv: switch to relative extable and other improvements") Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 805a3eb commit fc839c6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/net/bpf_jit_comp64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ static int add_exception_handler(const struct bpf_insn *insn,
497497
offset = pc - (long)&ex->insn;
498498
if (WARN_ON_ONCE(offset >= 0 || offset < INT_MIN))
499499
return -ERANGE;
500-
ex->insn = pc;
500+
ex->insn = offset;
501501

502502
/*
503503
* Since the extable follows the program, the fixup offset is always

0 commit comments

Comments
 (0)