feat(cardwire-ebpf): fallback to weakened state if sys_dents fails - #140
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesGetdents startup handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant EbpfBlocker_new
participant is_lockdown_enabled
participant sys_exit_getdents64
participant sys_enter_getdents64
EbpfBlocker_new->>sys_exit_getdents64: load and attach
sys_exit_getdents64-->>EbpfBlocker_new: success or failure
EbpfBlocker_new->>is_lockdown_enabled: read lockdown status on failure
EbpfBlocker_new->>sys_enter_getdents64: load and attach after exit success
Possibly related PRs
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/cardwire-ebpf-userspace/src/lib.rs`:
- Around line 67-132: Make attach failures non-fatal in the getdents tracepoint
setup: replace the `?` propagation on `cardwire_sys_exit_getdents64.attach` and
`cardwire_sys_enter_getdents64.attach` with warn-and-continue handling matching
their existing load failure branches. Preserve the weakened-state fallback and
include the attach error details in the warnings without aborting startup.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 090cf648-7878-4a73-bfbd-f78e209950f4
📒 Files selected for processing (1)
crates/cardwire-ebpf-userspace/src/lib.rs
Description
Cardwired can fail on system with kernel_lockdown enabled. This is due to the sys_exit_dents64 hook that re-write userspace memory, it gets rejected on secure booted system with
CONFIG_SECURITY_LOCKDOWN_LSM_EARLY_INITIALIZATION_ON_SECURE_BOOT=yTODO
Checklist: