* [PATCH bpf-next] bpftool: bpf_link_get_from_fd support for LSM programs in lskel
@ 2022-05-09 21:49 KP Singh
2022-05-10 17:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: KP Singh @ 2022-05-09 21:49 UTC (permalink / raw)
To: bpf; +Cc: KP Singh, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
bpf_link_get_from_fd currently returns a NULL fd for LSM programs.
LSM programs are similar to tracing programs and can also use
skel_raw_tracepoint_open.
Signed-off-by: KP Singh <kpsingh@kernel.org>
---
tools/bpf/bpftool/gen.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/bpf/bpftool/gen.c b/tools/bpf/bpftool/gen.c
index 7678af364793..e4a2bd3898a6 100644
--- a/tools/bpf/bpftool/gen.c
+++ b/tools/bpf/bpftool/gen.c
@@ -549,6 +549,7 @@ static void codegen_attach_detach(struct bpf_object *obj, const char *obj_name)
printf("\tint fd = skel_raw_tracepoint_open(\"%s\", prog_fd);\n", tp_name);
break;
case BPF_PROG_TYPE_TRACING:
+ case BPF_PROG_TYPE_LSM:
if (bpf_program__expected_attach_type(prog) == BPF_TRACE_ITER)
printf("\tint fd = skel_link_create(prog_fd, 0, BPF_TRACE_ITER);\n");
else
--
2.36.0.512.ge40c2bad7a-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH bpf-next] bpftool: bpf_link_get_from_fd support for LSM programs in lskel
2022-05-09 21:49 [PATCH bpf-next] bpftool: bpf_link_get_from_fd support for LSM programs in lskel KP Singh
@ 2022-05-10 17:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-05-10 17:50 UTC (permalink / raw)
To: KP Singh; +Cc: bpf, ast, daniel, andrii
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:
On Mon, 9 May 2022 21:49:05 +0000 you wrote:
> bpf_link_get_from_fd currently returns a NULL fd for LSM programs.
> LSM programs are similar to tracing programs and can also use
> skel_raw_tracepoint_open.
>
> Signed-off-by: KP Singh <kpsingh@kernel.org>
> ---
> tools/bpf/bpftool/gen.c | 1 +
> 1 file changed, 1 insertion(+)
Here is the summary with links:
- [bpf-next] bpftool: bpf_link_get_from_fd support for LSM programs in lskel
https://git.kernel.org/bpf/bpf-next/c/bd2331b3757f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-10 17:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-09 21:49 [PATCH bpf-next] bpftool: bpf_link_get_from_fd support for LSM programs in lskel KP Singh
2022-05-10 17:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox