LinuxDerivationBuilder: Use FD-based mounting API when available#15955
Open
xokdvium wants to merge 1 commit into
Open
LinuxDerivationBuilder: Use FD-based mounting API when available#15955xokdvium wants to merge 1 commit into
xokdvium wants to merge 1 commit into
Conversation
xokdvium
commented
Jun 1, 2026
Contributor
Author
|
Amazing, musl still doesn't have open_tree/move_mount wrappers :( |
We now use open_tree/move_mount syscalls when available. glibc version support shouldn't be too much of a concern at this point - the wrappers have been added in glibc 2.36. There also was not a whole lot of validation of the sandbox paths, which is now fixed too (`.`, `..` filename are rejected, everything escaping the chroot is too).
Contributor
Author
|
Also fixed the build with musl |
|
If /nix/store is writeable at the source the bind mounts in the sandbox will be writeable too. Is it out of scope to control the read-only state of the sandbox mounts? |
Contributor
Author
|
That's already the case, nothing has changed wrt to that. We have file level permissions to make stuff read-only, though I agree that it might be feasible to mount readonly, but I'm not sure how badly it would break things in practice. It might have ossified already enough that it would be a breaking change. I've done that previously for the new jail-based FreeBSD derivation builder. |
xokdvium
commented
Jun 2, 2026
Comment on lines
+101
to
+104
| "/foo/.." | ||
| "/foo/." | ||
| "/.." | ||
| "/." |
Contributor
Author
There was a problem hiding this comment.
Probably needs a few more tests.
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.
Motivation
We now use open_tree/move_mount syscalls when available. glibc version support shouldn't be too much of a concern at this point - the wrappers have been added in glibc 2.36.
There also was not a whole lot of validation of the sandbox paths, which is now fixed too (
.,..filename are rejected, everything escaping the chroot is too).Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.