Commit f8b19aec authored by Slava Imameev's avatar Slava Imameev Committed by Alexei Starovoitov
Browse files

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: default avatarSlava Imameev <slava.imameev@crowdstrike.com>
Reviewed-by: default avatarQuentin Monnet <qmo@kernel.org>
Link: https://lore.kernel.org/r/20250620151812.13952-2-slava.imameev@crowdstrike.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent d32179e8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment