* [PATCH bpf-next] bpftool: add kernel.kptr_restrict hint for no instructions
@ 2025-08-18 16:51 Vincent Li
2025-08-19 8:12 ` Daniel Borkmann
0 siblings, 1 reply; 3+ messages in thread
From: Vincent Li @ 2025-08-18 16:51 UTC (permalink / raw)
To: bpf
Cc: Quentin Monnet, Daniel Borkmann, Alexei Starovoitov,
Andrii Nakryiko, Martin KaFai Lau, Eduard Zingerman, Song Liu,
Yonghong Song, John Fastabend, KP Singh, Stanislav Fomichev,
Hao Luo, Jiri Olsa, Vincent Li
from bpftool github repo issue [0], when Linux distribution
kernel.kptr_restrict is set to 2, bpftool prog dump jited returns "no
instructions returned", this message can be puzzling to bpftool users
who is not familiar with kernel BPF internal, so add small hint for
bpftool users to check kernel.kptr_restrict setting. Set
kernel.kptr_restrict to expose kernel address to allow bpftool prog
dump jited to dump the jited bpf program instructions.
[0]: https://github.com/libbpf/bpftool/issues/184
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com.
---
tools/bpf/bpftool/prog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c
index 9722d841abc0..cf18c3879680 100644
--- a/tools/bpf/bpftool/prog.c
+++ b/tools/bpf/bpftool/prog.c
@@ -714,7 +714,7 @@ prog_dump(struct bpf_prog_info *info, enum dump_mode mode,
if (mode == DUMP_JITED) {
if (info->jited_prog_len == 0 || !info->jited_prog_insns) {
- p_info("no instructions returned");
+ p_err("error retrieving jit dump: no instructions returned or kernel.kptr_restrict set?");
return -1;
}
buf = u64_to_ptr(info->jited_prog_insns);
--
2.38.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] bpftool: add kernel.kptr_restrict hint for no instructions
2025-08-18 16:51 [PATCH bpf-next] bpftool: add kernel.kptr_restrict hint for no instructions Vincent Li
@ 2025-08-19 8:12 ` Daniel Borkmann
2025-08-19 15:13 ` Vincent Li
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Borkmann @ 2025-08-19 8:12 UTC (permalink / raw)
To: Vincent Li, bpf
Cc: Quentin Monnet, Alexei Starovoitov, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa
On 8/18/25 6:51 PM, Vincent Li wrote:
> from bpftool github repo issue [0], when Linux distribution
> kernel.kptr_restrict is set to 2, bpftool prog dump jited returns "no
> instructions returned", this message can be puzzling to bpftool users
> who is not familiar with kernel BPF internal, so add small hint for
> bpftool users to check kernel.kptr_restrict setting. Set
> kernel.kptr_restrict to expose kernel address to allow bpftool prog
> dump jited to dump the jited bpf program instructions.
>
> [0]: https://github.com/libbpf/bpftool/issues/184
>
> Signed-off-by: Vincent Li <vincent.mc.li@gmail.com.
I fixed up the email typo and rewrote the commit message a bit when applying
to bpf-next.
Thanks,
Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH bpf-next] bpftool: add kernel.kptr_restrict hint for no instructions
2025-08-19 8:12 ` Daniel Borkmann
@ 2025-08-19 15:13 ` Vincent Li
0 siblings, 0 replies; 3+ messages in thread
From: Vincent Li @ 2025-08-19 15:13 UTC (permalink / raw)
To: Daniel Borkmann
Cc: bpf, Quentin Monnet, Alexei Starovoitov, Andrii Nakryiko,
Martin KaFai Lau, Eduard Zingerman, Song Liu, Yonghong Song,
John Fastabend, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa
On Tue, Aug 19, 2025 at 1:12 AM Daniel Borkmann <daniel@iogearbox.net> wrote:
>
> On 8/18/25 6:51 PM, Vincent Li wrote:
> > from bpftool github repo issue [0], when Linux distribution
> > kernel.kptr_restrict is set to 2, bpftool prog dump jited returns "no
> > instructions returned", this message can be puzzling to bpftool users
> > who is not familiar with kernel BPF internal, so add small hint for
> > bpftool users to check kernel.kptr_restrict setting. Set
> > kernel.kptr_restrict to expose kernel address to allow bpftool prog
> > dump jited to dump the jited bpf program instructions.
> >
> > [0]: https://github.com/libbpf/bpftool/issues/184
> >
> > Signed-off-by: Vincent Li <vincent.mc.li@gmail.com.
>
> I fixed up the email typo and rewrote the commit message a bit when applying
> to bpf-next.
>
Sorry about the typo, maybe I should have asked AI first to write a
commit message for me :).
> Thanks,
> Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-19 15:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-18 16:51 [PATCH bpf-next] bpftool: add kernel.kptr_restrict hint for no instructions Vincent Li
2025-08-19 8:12 ` Daniel Borkmann
2025-08-19 15:13 ` Vincent Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).