diff mbox series

[bpf-next] bpftool: bpf_link_get_from_fd support for LSM programs in lskel

Message ID 20220509214905.3754984-1-kpsingh@kernel.org (mailing list archive)
State Accepted
Commit bd2331b3757f5b2ab4aafc591b55fa2a592abf7c
Delegated to: BPF
Headers show
Series [bpf-next] bpftool: bpf_link_get_from_fd support for LSM programs in lskel | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers warning 7 maintainers not CCed: netdev@vger.kernel.org kafai@fb.com delyank@fb.com john.fastabend@gmail.com yhs@fb.com songliubraving@fb.com mauricio@kinvolk.io
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-1 success Logs for Kernel LATEST on ubuntu-latest + selftests
bpf/vmtest-bpf-next-VM_Test-2 success Logs for Kernel LATEST on z15 + selftests

Commit Message

KP Singh May 9, 2022, 9:49 p.m. UTC
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(+)

Comments

patchwork-bot+netdevbpf@kernel.org May 10, 2022, 5:50 p.m. UTC | #1
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!
diff mbox series

Patch

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