Skip to content

Commit bd2331b

Browse files
sinkapAlexei Starovoitov
authored andcommitted
bpftool: bpf_link_get_from_fd support for LSM programs in lskel
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 <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent a82ebb0 commit bd2331b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/bpf/bpftool/gen.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ static void codegen_attach_detach(struct bpf_object *obj, const char *obj_name)
549549
printf("\tint fd = skel_raw_tracepoint_open(\"%s\", prog_fd);\n", tp_name);
550550
break;
551551
case BPF_PROG_TYPE_TRACING:
552+
case BPF_PROG_TYPE_LSM:
552553
if (bpf_program__expected_attach_type(prog) == BPF_TRACE_ITER)
553554
printf("\tint fd = skel_link_create(prog_fd, 0, BPF_TRACE_ITER);\n");
554555
else

0 commit comments

Comments
 (0)