Commit fc839c6d authored by Jisheng Zhang's avatar Jisheng Zhang Committed by Palmer Dabbelt

riscv: bpf: Fix eBPF's exception tables

eBPF's exception tables needs to be modified to relative synchronously.
Suggested-by: default avatarTong Tiangen <tongtiangen@huawei.com>
Signed-off-by: default avatarJisheng Zhang <jszhang@kernel.org>
Fixes: 1f77ed94 ("riscv: switch to relative extable and other improvements")
Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
parent 805a3ebe
...@@ -497,7 +497,7 @@ static int add_exception_handler(const struct bpf_insn *insn, ...@@ -497,7 +497,7 @@ static int add_exception_handler(const struct bpf_insn *insn,
offset = pc - (long)&ex->insn; offset = pc - (long)&ex->insn;
if (WARN_ON_ONCE(offset >= 0 || offset < INT_MIN)) if (WARN_ON_ONCE(offset >= 0 || offset < INT_MIN))
return -ERANGE; return -ERANGE;
ex->insn = pc; ex->insn = offset;
/* /*
* Since the extable follows the program, the fixup offset is always * Since the extable follows the program, the fixup offset is always
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment