fix(security): warn when Landlock may silently degrade#868
fix(security): warn when Landlock may silently degrade#868fdzdev wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds post-sandbox-creation warnings about Landlock filesystem isolation: an unconditional macOS warning about Docker VM kernel dependency, and a best-effort Linux kernel check via Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
cv
left a comment
There was a problem hiding this comment.
The underlying issue is real — best_effort silently dropping Landlock is worth surfacing. The Linux host kernel check is straightforward and correct since Docker shares the host kernel.
The macOS path is weak though: it warns every macOS user unconditionally when it could just check the Docker VM's actual kernel version via docker info --format '{{.KernelVersion}}'. That gives you the VM kernel without even spinning up a container. If that's ≥ 5.13, there's nothing to warn about.
As-is, the macOS warning is noisy without being actionable — it tells the user "depends on the Docker VM kernel" but doesn't do the one thing that would answer the question.
|
FYI — OpenShell is already tracking this upstream:
Once that lands, OpenShell itself will report whether Landlock enforcement actually stuck, which makes the host-side kernel guessing here unnecessary. |
The base sandbox policy uses landlock compatibility: best_effort which silently drops filesystem restrictions on unsupported kernels (CWE-440, NVBUG 6002804). Add a post-creation check that warns on macOS hosts and Linux kernels < 5.13. Wrapped in try/catch so the warning never blocks sandbox creation. Made-with: Cursor
e06072c to
93db763
Compare
Summary
landlock: compatibility: best_effortwhich silently drops filesystem restrictions on unsupported kernels (CWE-440, NVBUG 6002804)createSandbox()that warns on macOS hosts and Linux kernels < 5.13Test plan
nemoclaw onboardon macOS → see⚠ Landlock: macOS hostwarning after sandbox creationnemoclaw onboardon Linux ≥ 5.13 → no warningnemoclaw onboardon Linux < 5.13 → see⚠ Landlock: Kernel X.Y does not support Landlockwarninguname -rfails for any reason → no crash, no warning (try/catch)Summary by CodeRabbit