[PATCH bpf-next v3 2/2] selftests/bpf: Add test for bpftool access to read-only protected maps

2025-06-11 Thread Slava Imameev
inned Signed-off-by: Slava Imameev --- Changes in v2: - fix for a test compilation error: "conflicting types for 'bpf_fentry_test1'" Changes in v3: - Addressed review feedback - Added tests for map iterator, map and map-of-maps creation, deletion - Cleaned up excessive outp

[PATCH bpf-next v3 1/2] bpftool: Use appropriate permissions for map access

2025-06-11 Thread Slava Imameev
modification via security_bpf_map. Signed-off-by: Slava Imameev --- Changes in v2: - fix for a test compilation error: "conflicting types for 'bpf_fentry_test1'" Changes in v3: - Addressed review feedback - Converted the check for flags to an assert in map_parse_fds - Modifi

Re: [PATCH bpf-next v2 1/2] bpftool: Use appropriate permissions for map access

2025-06-11 Thread Slava Imameev
fixes errors when reading from maps > > that are protected from modification via security_bpf_map. > > > > Signed-off-by: Slava Imameev > > > Thanks for this! > > I think the topic of map access in bpftool has been discussed in the > path, but I can't remem

Re: [PATCH bpf-next v2 2/2] selftests/bpf: Add test for bpftool access to read-only protected maps

2025-06-11 Thread Slava Imameev
> > + make -C tools/bpf/bpftool -s -j"$ncpus" OUTPUT="$output_dir"/ >/dev/null > > + echo ... finished building bpftool > > + cd "$pwd" > > +} > > > Given that you're reusing the BPF selftests infra, you shouldn't have to > rebuild bpftool as part of the test. It's already built from the > Ma

Re: [PATCH bpf-next v2 1/2] bpftool: Use appropriate permissions for map access

2025-06-11 Thread Slava Imameev
fixes errors when reading from maps > > that are protected from modification via security_bpf_map. > > > > Signed-off-by: Slava Imameev > > > Thanks for this! > > I think the topic of map access in bpftool has been discussed in the > path, but I can'

[PATCH bpf-next v2 1/2] bpftool: Use appropriate permissions for map access

2025-05-30 Thread Slava Imameev
modification via security_bpf_map. Signed-off-by: Slava Imameev --- Changes in v2: - fix for a test compilation error: "conflicting types for 'bpf_fentry_test1'" --- --- tools/bpf/bpftool/btf.c | 3 +- tools/bpf/bpftool/common.c| 57 ++

[PATCH bpf-next v2 2/2] selftests/bpf: Add test for bpftool access to read-only protected maps

2025-05-30 Thread Slava Imameev
inned Signed-off-by: Slava Imameev --- Changes in v2: - fix for a test compilation error: "conflicting types for 'bpf_fentry_test1'" --- --- tools/testing/selftests/bpf/Makefile | 1 + .../selftests/bpf/progs/security_bpf_map.c| 56 + .../testing/selftest

[PATCH bpf-next 2/2] selftests/bpf: Add test for bpftool access to read-only protected maps

2025-05-30 Thread Slava Imameev
inned Signed-off-by: Slava Imameev --- tools/testing/selftests/bpf/Makefile | 1 + .../selftests/bpf/progs/security_bpf_map.c| 56 + .../testing/selftests/bpf/test_bpftool_map.sh | 208 ++ 3 files changed, 265 insertions(+) create mode 100644 tools/testing/self

[PATCH bpf-next 1/2] bpftool: Use appropriate permissions for map access

2025-05-30 Thread Slava Imameev
modification via security_bpf_map. Signed-off-by: Slava Imameev --- tools/bpf/bpftool/btf.c | 3 +- tools/bpf/bpftool/common.c| 57 ++- tools/bpf/bpftool/iter.c | 2 +- tools/bpf/bpftool/link.c | 2 +- tools/bpf/bpftool/main.h

Re: Re: Re: Re: Re: [PATCH 2/2] libbpf: BPF programs dynamic loading and attaching

2025-02-24 Thread Slava Imameev
This reply was resent as the previous email had a missing In-Reply-To in the header. > > > On Mon, 2025-02-10 at 16:06 -0800, Andrii Nakryiko wrote: > > > > Tracking associated maps for a program is not necessary. As long as > > > > the last BPF program using the BPF map is unloaded, the kernel wi

Re: Re: Re: Re: Re: [PATCH 2/2] libbpf: BPF programs dynamic loading and attaching

2025-02-24 Thread Slava Imameev
> > > On Mon, 2025-02-10 at 16:06 -0800, Andrii Nakryiko wrote: > > > > Tracking associated maps for a program is not necessary. As long as > > > > the last BPF program using the BPF map is unloaded, the kernel will > > > > automatically free not-anymore-referenced BPF map. Note that > > > > bpf_ob

[PATCH 1/2] libbpf: BPF program load type enum

2025-01-22 Thread Slava Imameev
range. This patch is the first in a series of two. Signed-off-by: Slava Imameev --- tools/lib/bpf/libbpf.c| 50 --- tools/lib/bpf/libbpf.h| 16 ++ tools/lib/bpf/libbpf.map | 2 + .../selftests/bpf/prog_tests

[PATCH 2/2] libbpf: BPF programs dynamic loading and attaching

2025-01-22 Thread Slava Imameev
. This patch addresses that inefficiency. Signed-off-by: Slava Imameev --- tools/lib/bpf/libbpf.c| 144 +++-- tools/lib/bpf/libbpf.h| 5 +- tools/lib/bpf/libbpf.map | 2 + .../selftests/bpf/prog_tests