Skip to content

Commit 0b99945

Browse files
vincentmliqmonnet
authored andcommitted
bpftool: Add kernel.kptr_restrict hint for no instructions
From bpftool's github repository issue [0]: When a Linux distribution has the kernel.kptr_restrict set to 2, bpftool prog dump jited returns "no instructions returned". This message can be puzzling to bpftool users who are not familiar with kernel BPF internals, so add a small hint for bpftool users to check the kernel.kptr_restrict setting similar to the DUMP_XLATED case. Outside of kernel.kptr_restrict, no instructions could also be returned in case the JIT was disabled. Signed-off-by: Vincent Li <vincent.mc.li@gmail.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Daniel Borkmann <daniel@iogearbox.net> Link: #184 [0] Link: https://lore.kernel.org/bpf/20250818165113.15982-1-vincent.mc.li@gmail.com
1 parent 9a1d7b3 commit 0b99945

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/prog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ prog_dump(struct bpf_prog_info *info, enum dump_mode mode,
714714

715715
if (mode == DUMP_JITED) {
716716
if (info->jited_prog_len == 0 || !info->jited_prog_insns) {
717-
p_info("no instructions returned");
717+
p_err("error retrieving jit dump: no instructions returned or kernel.kptr_restrict set?");
718718
return -1;
719719
}
720720
buf = u64_to_ptr(info->jited_prog_insns);

0 commit comments

Comments
 (0)