Repository navigation
Revert "Custom sandboxing implementation as linux usernamespace calls - port cachepot/#128" - #1689
Merged
Merged
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## main #1689 +/- ##
==========================================
- Coverage 29.61% 29.47% -0.15%
==========================================
Files 49 49
Lines 17032 17027 -5
Branches 8208 8207 -1
==========================================
- Hits 5044 5018 -26
- Misses 6984 6988 +4
- Partials 5004 5021 +17
... and 17 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
3 tasks
rrbutani
added a commit
to rrbutani/sccache
that referenced
this pull request
Jun 9, 2026
… root the approach here is more or less the same as in mozilla#1628: use `CLONE_NEWUSER` (unprivileged user namespace) to be able to create a mount namespace + mount the overlayFS mounts without permissions unlike mozilla#1628, this PR leverages [`bubblewrap`'s overlay mount functionality](containers/bubblewrap@f371022) (added in `v0.11.0`) to create the overlayFS mounts at the `sccache-dist` → `bwrap` compile command process boundary. This has a couple of upsides: - sidesteps the [safety issues](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L447-L458) in mozilla#1628 caused by forking the `sccache-dist` process - avoids the [issue](mozilla#1688) with overlay fs mounts not being unmounted once the compile command finishes that ultimately led to mozilla#1628 being [reverted](mozilla#1689) + though, I think this issue was actually caused by mozilla#1628 changing the default sandboxing codepath (i.e. `current_ns`) to call `CLONE_NEWNS` [in the `sccache-dist`'s `rouille` request handler thread](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L422-L429) instead of [in the thread spawned for a compile](https://github.com/mozilla/sccache/blob/c72eed63d78c8550b93133e9fa461a0c6ef7a30d/src/bin/sccache-dist/build.rs#L272-L276) (and not anything to do with the unprivileged user namespace logic) other notes: - previously deleting the build directory/the per-compile directories did not run into permission issues because `sccache-dist` was running as root closes mozilla#326, closes mozilla#1660 closes mozilla#1688 supersedes mozilla#2706
luhenry
pushed a commit
to luhenry/sccache
that referenced
this pull request
Jul 24, 2026
… root the approach here is more or less the same as in mozilla#1628: use `CLONE_NEWUSER` (unprivileged user namespace) to be able to create a mount namespace + mount the overlayFS mounts without permissions unlike mozilla#1628, this PR leverages [`bubblewrap`'s overlay mount functionality](containers/bubblewrap@f371022) (added in `v0.11.0`) to create the overlayFS mounts at the `sccache-dist` → `bwrap` compile command process boundary. This has a couple of upsides: - sidesteps the [safety issues](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L447-L458) in mozilla#1628 caused by forking the `sccache-dist` process - avoids the [issue](mozilla#1688) with overlay fs mounts not being unmounted once the compile command finishes that ultimately led to mozilla#1628 being [reverted](mozilla#1689) + though, I think this issue was actually caused by mozilla#1628 changing the default sandboxing codepath (i.e. `current_ns`) to call `CLONE_NEWNS` [in the `sccache-dist`'s `rouille` request handler thread](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L422-L429) instead of [in the thread spawned for a compile](https://github.com/mozilla/sccache/blob/c72eed63d78c8550b93133e9fa461a0c6ef7a30d/src/bin/sccache-dist/build.rs#L272-L276) (and not anything to do with the unprivileged user namespace logic) other notes: - previously deleting the build directory/the per-compile directories did not run into permission issues because `sccache-dist` was running as root closes mozilla#326, closes mozilla#1660 closes mozilla#1688 supersedes mozilla#2706
rrbutani
added a commit
to rrbutani/sccache
that referenced
this pull request
Jul 30, 2026
… root the approach here is more or less the same as in mozilla#1628: use `CLONE_NEWUSER` (unprivileged user namespace) to be able to create a mount namespace + mount the overlayFS mounts without permissions unlike mozilla#1628, this PR leverages [`bubblewrap`'s overlay mount functionality](containers/bubblewrap@f371022) (added in `v0.11.0`) to create the overlayFS mounts at the `sccache-dist` → `bwrap` compile command process boundary. This has a couple of upsides: - sidesteps the [safety issues](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L447-L458) in mozilla#1628 caused by forking the `sccache-dist` process - avoids the [issue](mozilla#1688) with overlay fs mounts not being unmounted once the compile command finishes that ultimately led to mozilla#1628 being [reverted](mozilla#1689) + though, I think this issue was actually caused by mozilla#1628 changing the default sandboxing codepath (i.e. `current_ns`) to call `CLONE_NEWNS` [in the `sccache-dist`'s `rouille` request handler thread](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L422-L429) instead of [in the thread spawned for a compile](https://github.com/mozilla/sccache/blob/c72eed63d78c8550b93133e9fa461a0c6ef7a30d/src/bin/sccache-dist/build.rs#L272-L276) (and not anything to do with the unprivileged user namespace logic) other notes: - previously deleting the build directory/the per-compile directories did not run into permission issues because `sccache-dist` was running as root closes mozilla#326, closes mozilla#1660 closes mozilla#1688 supersedes mozilla#2706
rrbutani
added a commit
to rrbutani/sccache
that referenced
this pull request
Aug 6, 2026
… root the approach here is more or less the same as in mozilla#1628: use `CLONE_NEWUSER` (unprivileged user namespace) to be able to create a mount namespace + mount the overlayFS mounts without permissions unlike mozilla#1628, this PR leverages [`bubblewrap`'s overlay mount functionality](containers/bubblewrap@f371022) (added in `v0.11.0`) to create the overlayFS mounts at the `sccache-dist` → `bwrap` compile command process boundary. This has a couple of upsides: - sidesteps the [safety issues](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L447-L458) in mozilla#1628 caused by forking the `sccache-dist` process - avoids the [issue](mozilla#1688) with overlay fs mounts not being unmounted once the compile command finishes that ultimately led to mozilla#1628 being [reverted](mozilla#1689) + though, I think this issue was actually caused by mozilla#1628 changing the default sandboxing codepath (i.e. `current_ns`) to call `CLONE_NEWNS` [in the `sccache-dist`'s `rouille` request handler thread](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L422-L429) instead of [in the thread spawned for a compile](https://github.com/mozilla/sccache/blob/c72eed63d78c8550b93133e9fa461a0c6ef7a30d/src/bin/sccache-dist/build.rs#L272-L276) (and not anything to do with the unprivileged user namespace logic) other notes: - previously deleting the build directory/the per-compile directories did not run into permission issues because `sccache-dist` was running as root closes mozilla#326, closes mozilla#1660 closes mozilla#1688 supersedes mozilla#2706
rrbutani
added a commit
to rrbutani/sccache
that referenced
this pull request
Aug 11, 2026
… root the approach here is more or less the same as in mozilla#1628: use `CLONE_NEWUSER` (unprivileged user namespace) to be able to create a mount namespace + mount the overlayFS mounts without permissions unlike mozilla#1628, this PR leverages [`bubblewrap`'s overlay mount functionality](containers/bubblewrap@f371022) (added in `v0.11.0`) to create the overlayFS mounts at the `sccache-dist` → `bwrap` compile command process boundary. This has a couple of upsides: - sidesteps the [safety issues](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L447-L458) in mozilla#1628 caused by forking the `sccache-dist` process - avoids the [issue](mozilla#1688) with overlay fs mounts not being unmounted once the compile command finishes that ultimately led to mozilla#1628 being [reverted](mozilla#1689) + though, I think this issue was actually caused by mozilla#1628 changing the default sandboxing codepath (i.e. `current_ns`) to call `CLONE_NEWNS` [in the `sccache-dist`'s `rouille` request handler thread](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L422-L429) instead of [in the thread spawned for a compile](https://github.com/mozilla/sccache/blob/c72eed63d78c8550b93133e9fa461a0c6ef7a30d/src/bin/sccache-dist/build.rs#L272-L276) (and not anything to do with the unprivileged user namespace logic) other notes: - previously deleting the build directory/the per-compile directories did not run into permission issues because `sccache-dist` was running as root closes mozilla#326, closes mozilla#1660 closes mozilla#1688 supersedes mozilla#2706
rrbutani
added a commit
to rrbutani/sccache
that referenced
this pull request
Aug 21, 2026
… root the approach here is more or less the same as in mozilla#1628: use `CLONE_NEWUSER` (unprivileged user namespace) to be able to create a mount namespace + mount the overlayFS mounts without permissions unlike mozilla#1628, this PR leverages [`bubblewrap`'s overlay mount functionality](containers/bubblewrap@f371022) (added in `v0.11.0`) to create the overlayFS mounts at the `sccache-dist` → `bwrap` compile command process boundary. This has a couple of upsides: - sidesteps the [safety issues](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L447-L458) in mozilla#1628 caused by forking the `sccache-dist` process - avoids the [issue](mozilla#1688) with overlay fs mounts not being unmounted once the compile command finishes that ultimately led to mozilla#1628 being [reverted](mozilla#1689) + though, I think this issue was actually caused by mozilla#1628 changing the default sandboxing codepath (i.e. `current_ns`) to call `CLONE_NEWNS` [in the `sccache-dist`'s `rouille` request handler thread](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L422-L429) instead of [in the thread spawned for a compile](https://github.com/mozilla/sccache/blob/c72eed63d78c8550b93133e9fa461a0c6ef7a30d/src/bin/sccache-dist/build.rs#L272-L276) (and not anything to do with the unprivileged user namespace logic) other notes: - previously deleting the build directory/the per-compile directories did not run into permission issues because `sccache-dist` was running as root closes mozilla#326, closes mozilla#1660 closes mozilla#1688 supersedes mozilla#2706
rrbutani
added a commit
to rrbutani/sccache
that referenced
this pull request
Sep 15, 2026
… root the approach here is more or less the same as in mozilla#1628: use `CLONE_NEWUSER` (unprivileged user namespace) to be able to create a mount namespace + mount the overlayFS mounts without permissions unlike mozilla#1628, this PR leverages [`bubblewrap`'s overlay mount functionality](containers/bubblewrap@f371022) (added in `v0.11.0`) to create the overlayFS mounts at the `sccache-dist` → `bwrap` compile command process boundary. This has a couple of upsides: - sidesteps the [safety issues](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L447-L458) in mozilla#1628 caused by forking the `sccache-dist` process - avoids the [issue](mozilla#1688) with overlay fs mounts not being unmounted once the compile command finishes that ultimately led to mozilla#1628 being [reverted](mozilla#1689) + though, I think this issue was actually caused by mozilla#1628 changing the default sandboxing codepath (i.e. `current_ns`) to call `CLONE_NEWNS` [in the `sccache-dist`'s `rouille` request handler thread](https://github.com/mozilla/sccache/blob/9fb6a2542c0d2e82846252be19bb377e5ca8885b/src/bin/sccache-dist/build.rs#L422-L429) instead of [in the thread spawned for a compile](https://github.com/mozilla/sccache/blob/c72eed63d78c8550b93133e9fa461a0c6ef7a30d/src/bin/sccache-dist/build.rs#L272-L276) (and not anything to do with the unprivileged user namespace logic) other notes: - previously deleting the build directory/the per-compile directories did not run into permission issues because `sccache-dist` was running as root closes mozilla#326, closes mozilla#1660 closes mozilla#1688 supersedes mozilla#2706
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reverts #1628
causes
issue #1688