What problem does this solve?
We currently detect BPF availability in the project through seeing if there is a bpf entry in /sys/kernel/security/lsm. But that file may have a false entry, or may not be mounted on that path. Resulting in a state where LSM may be present but undetected or falsely announced as available. We currently fallback to fmod_ret for all of those cases. A better strategy to detect this would be to actually try to load and attach LSM programs during init, and if they fail only do we fallback to trying fmod_ret which may also fail. In that case open/exec enforcement becomes truly unavailable and this should be announced to the user
Proposed change
See the fallback review discussion
Alternatives considered
No response.
Additional context
No response.
Delivery planning
Outcome: Trust protection. Priority: P1.
Attempt actual BPF-LSM load/attach, clean up failed partial state, then try fmod_ret. Test missing securityfs, load failure, attach failure, fallback success, and both paths unavailable. Record the selected hook and failure reasons per affected policy/node. Coordinate status with #188; behavior checks belong in #191.
Follow the repository build/test, kind behavior, documentation and redaction requirements. Acceptance must distinguish prevention from observation.
What problem does this solve?
We currently detect BPF availability in the project through seeing if there is a
bpfentry in/sys/kernel/security/lsm. But that file may have a false entry, or may not be mounted on that path. Resulting in a state where LSM may be present but undetected or falsely announced as available. We currently fallback tofmod_retfor all of those cases. A better strategy to detect this would be to actually try to load and attach LSM programs during init, and if they fail only do we fallback to tryingfmod_retwhich may also fail. In that case open/exec enforcement becomes truly unavailable and this should be announced to the userProposed change
See the fallback review discussion
Alternatives considered
No response.
Additional context
No response.
Delivery planning
Outcome: Trust protection. Priority: P1.
Attempt actual BPF-LSM load/attach, clean up failed partial state, then try fmod_ret. Test missing securityfs, load failure, attach failure, fallback success, and both paths unavailable. Record the selected hook and failure reasons per affected policy/node. Coordinate status with #188; behavior checks belong in #191.
Follow the repository build/test, kind behavior, documentation and redaction requirements. Acceptance must distinguish prevention from observation.