Skip to content

fix: contain sandbox descendants with util-linux - #78

Open
kim-em wants to merge 2 commits into
leanprover:fail-closed-optionfrom
kim-em:fix/descendant-cleanup
Open

fix: contain sandbox descendants with util-linux#78
kim-em wants to merge 2 commits into
leanprover:fail-closed-optionfrom
kim-em:fix/descendant-cleanup

Conversation

@kim-em

@kim-em kim-em commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

This PR contains each sandboxed command in a fresh user, PID, and mount namespace when the host supports unprivileged namespaces, ensuring that processes left behind by the command are killed before Comparator continues.

Comparator preflights the exact setpriv and unshare supervisor before starting any workload. A successful preflight is used for every workload Landrun invocation, including external kernels. With fail_closed: true, setup failure produces an actionable error and no workload starts. With fail_closed: false, Comparator warns once and runs Landrun without descendant containment. It never retries a workload command.

The error reports the setup diagnostic and relevant util-linux, sysctl, and container guidance. The CI workflow configures the required user-namespace settings on ubuntu-latest before running the test suite.

Tests cover namespace setup failure, strict and compatibility behavior, and cleanup of a detached setsid descendant.

Closes #77.

@kim-em
kim-em force-pushed the fix/descendant-cleanup branch from 7dff5cf to bae26be Compare August 20, 2026 05:45
@kim-em
kim-em changed the base branch from master to fail-closed-option August 20, 2026 05:45
@kim-em
kim-em force-pushed the fix/descendant-cleanup branch from bae26be to 059f494 Compare August 20, 2026 05:49
@kim-em
kim-em force-pushed the fail-closed-option branch from 186f188 to e950087 Compare August 20, 2026 06:21
@kim-em
kim-em force-pushed the fix/descendant-cleanup branch 2 times, most recently from 443870b to 60066c6 Compare August 20, 2026 07:29
@kim-em
kim-em force-pushed the fail-closed-option branch from e730d1a to 4534d81 Compare August 20, 2026 12:55
@kim-em
kim-em force-pushed the fix/descendant-cleanup branch from 60066c6 to 8f6f285 Compare August 20, 2026 12:55
@kim-em kim-em changed the title fix: contain sandbox descendants in PID namespaces fix: contain sandbox descendants with util-linux Aug 20, 2026
@kim-em
kim-em force-pushed the fail-closed-option branch from 4534d81 to 5846789 Compare August 20, 2026 13:34
@kim-em
kim-em force-pushed the fix/descendant-cleanup branch from 8f6f285 to 14b5039 Compare August 20, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Untrusted descendants can outlive safeLakeBuild

1 participant