@@ -1297,7 +1297,7 @@ st: if (is_imm8(insn->off))emit_ldx(&prog,BPF_SIZE(insn->code),dst_reg,src_reg,insn->off);if(BPF_MODE(insn->code)==BPF_PROBE_MEM){structexception_table_entry*ex;-u8*_insn=image+proglen;+u8*_insn=image+proglen+(u8)(start_of_ldx-temp);
Great debugging and the fix. Thanks a lot.
I've dropped (u8) cast, kept (), and applied to bpf tree.
I think it looks cleaner without that cast.
Could you send a followup patch with a selftest, so I don't make
the same mistake again ? ;)
@@ -1297,7 +1297,7 @@ st: if (is_imm8(insn->off))emit_ldx(&prog,BPF_SIZE(insn->code),dst_reg,src_reg,insn->off);if(BPF_MODE(insn->code)==BPF_PROBE_MEM){structexception_table_entry*ex;-u8*_insn=image+proglen;+u8*_insn=image+proglen+(u8)(start_of_ldx-temp);
Great debugging and the fix. Thanks a lot.
I've dropped (u8) cast, kept (), and applied to bpf tree.
I think it looks cleaner without that cast.
Thanks.
Could you send a followup patch with a selftest, so I don't make
the same mistake again ? ;)
Unfortunately extable gets involved only for bad kernel pointers and
ideally there should not be any bad pointer in kernel. So there is no
easy way to create a proper selftest for this.
Ravi
On Thu, Jun 24, 2021 at 11:22 PM Ravi Bangoria
[off-list ref] wrote:
quoted
Could you send a followup patch with a selftest, so I don't make
the same mistake again ? ;)
Unfortunately extable gets involved only for bad kernel pointers and
ideally there should not be any bad pointer in kernel. So there is no
easy way to create a proper selftest for this.
Right. We have lib/test_bpf.c kernel module for such cases.