linux/tools/bpf/bpftool
Stanislav Fomichev 596f5fb2ea bpftool: implement cgroup tree for BPF_LSM_CGROUP
$ bpftool --nomount prog loadall $KDIR/tools/testing/selftests/bpf/lsm_cgroup.o /sys/fs/bpf/x
$ bpftool cgroup attach /sys/fs/cgroup lsm_cgroup pinned /sys/fs/bpf/x/socket_alloc
$ bpftool cgroup attach /sys/fs/cgroup lsm_cgroup pinned /sys/fs/bpf/x/socket_bind
$ bpftool cgroup attach /sys/fs/cgroup lsm_cgroup pinned /sys/fs/bpf/x/socket_clone
$ bpftool cgroup attach /sys/fs/cgroup lsm_cgroup pinned /sys/fs/bpf/x/socket_post_create
$ bpftool cgroup tree
CgroupPath
ID       AttachType      AttachFlags     Name
/sys/fs/cgroup
6        lsm_cgroup                      socket_post_create bpf_lsm_socket_post_create
8        lsm_cgroup                      socket_bind     bpf_lsm_socket_bind
10       lsm_cgroup                      socket_alloc    bpf_lsm_sk_alloc_security
11       lsm_cgroup                      socket_clone    bpf_lsm_inet_csk_clone

$ bpftool cgroup detach /sys/fs/cgroup lsm_cgroup pinned /sys/fs/bpf/x/socket_post_create
$ bpftool cgroup tree
CgroupPath
ID       AttachType      AttachFlags     Name
/sys/fs/cgroup
8        lsm_cgroup                      socket_bind     bpf_lsm_socket_bind
10       lsm_cgroup                      socket_alloc    bpf_lsm_sk_alloc_security
11       lsm_cgroup                      socket_clone    bpf_lsm_inet_csk_clone

Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Link: https://lore.kernel.org/r/20220628174314.1216643-11-sdf@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2022-06-29 13:21:52 -07:00
..
bash-completion bpftool: Use libbpf_bpf_attach_type_str 2022-06-02 16:26:30 -07:00
Documentation bpftool: Use libbpf_bpf_attach_type_str 2022-06-02 16:26:30 -07:00
skeleton bpftool: Add bpf_cookie to link output 2022-03-15 15:07:27 -07:00
.gitignore bpftool: Fix SPDX tag for Makefiles and .gitignore 2021-11-10 09:00:52 -08:00
btf_dumper.c bpftool: Add btf enum64 support 2022-06-07 10:20:43 -07:00
btf.c bpftool: Add btf enum64 support 2022-06-07 10:20:43 -07:00
cfg.c tools, bpftool: Poison and replace kernel integer typedefs 2020-05-11 21:20:46 +02:00
cfg.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00
cgroup.c bpftool: implement cgroup tree for BPF_LSM_CGROUP 2022-06-29 13:21:52 -07:00
common.c Revert "bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK" 2022-06-14 22:18:06 +02:00
feature.c Revert "bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK" 2022-06-14 22:18:06 +02:00
gen.c bpftool: Add btf enum64 support 2022-06-07 10:20:43 -07:00
iter.c bpftool: Use libbpf_get_error() to check error 2021-11-14 18:38:13 -08:00
jit_disasm.c bpftool: Properly close va_list 'ap' by va_end() on error 2021-07-06 09:19:23 +02:00
json_writer.c bpftool: Support dumping metadata 2020-09-15 18:28:27 -07:00
json_writer.h bpftool: Support dumping metadata 2020-09-15 18:28:27 -07:00
link.c bpftool: Use libbpf_bpf_link_type_str 2022-06-02 16:26:38 -07:00
main.c bpftool: Do not check return value from libbpf_set_strict_mode() 2022-06-14 22:18:56 +02:00
main.h Revert "bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK" 2022-06-14 22:18:06 +02:00
Makefile bpftool: Fix bootstrapping during a cross compilation 2022-06-09 14:01:21 +02:00
map_perf_ring.c bpftool: Update btf_dump__new() and perf_buffer__new_raw() calls 2021-11-11 16:54:06 -08:00
map.c Revert "bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK" 2022-06-14 22:18:06 +02:00
net.c bpftool: use new API for attaching XDP program 2022-01-20 21:22:02 -08:00
netlink_dumper.c bpftool: Use consistent include paths for libbpf 2020-01-20 16:37:45 -08:00
netlink_dumper.h tools: bpftool: dual license all files 2018-12-13 12:08:44 +01:00
perf.c bpftool, musl compat: Replace nftw with FTW_ACTIONRETVAL 2022-04-25 23:24:16 +02:00
pids.c Revert "bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK" 2022-06-14 22:18:06 +02:00
prog.c Revert "bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK" 2022-06-14 22:18:06 +02:00
struct_ops.c Revert "bpftool: Use libbpf 1.0 API mode instead of RLIMIT_MEMLOCK" 2022-06-14 22:18:06 +02:00
tracelog.c bpftool, musl compat: Replace sys/fcntl.h by fcntl.h 2022-04-25 23:24:28 +02:00
xlated_dumper.c bpftool: Remove usage of reallocarray() 2022-02-23 13:55:01 -08:00
xlated_dumper.h tools: bpftool: replace Netronome boilerplate with SPDX license headers 2018-12-13 12:08:44 +01:00