diff options
| author | Slava Imameev <[email protected]> | 2025-06-20 15:18:12 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2025-06-20 18:13:03 +0000 |
| commit | f8b19aeca1652fcadefce8529cd85e5fd475dd69 (patch) | |
| tree | 23ec22ff984f45d6447d0cef97892fd501b419cf /tools/bpf/bpftool/net.c | |
| parent | bpftool: Use appropriate permissions for map access (diff) | |
| download | kernel-f8b19aeca1652fcadefce8529cd85e5fd475dd69.tar.gz kernel-f8b19aeca1652fcadefce8529cd85e5fd475dd69.zip | |
selftests/bpf: Add test for bpftool access to read-only protected maps
Add selftest cases that validate bpftool's expected behavior when
accessing maps protected from modification via security_bpf_map.
The test includes a BPF program attached to security_bpf_map with two maps:
- A protected map that only allows read-only access
- An unprotected map that allows full access
The test script attaches the BPF program to security_bpf_map and
verifies that for the bpftool map command:
- Read access works on both maps
- Write access fails on the protected map
- Write access succeeds on the unprotected map
- These behaviors remain consistent when the maps are pinned
Signed-off-by: Slava Imameev <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/net.c')
0 files changed, 0 insertions, 0 deletions
