FFFF (Linux) Derivation input corruption when building derivations without build users in a chroot store · Issue #16645 · NixOS/nix · GitHub
[go: up one dir, main page]

Skip to content

(Linux) Derivation input corruption when building derivations without build users in a chroot store #16645

Open

Description

@xokdvium

Describe the bug

Steps To Reproduce

Don't use build users and build in a chroot store in a single-user (without build users) manner on Linux. Sandboxing is enabled since there's no other way to build in a chroot store.

E.g:

nix repl --store /tmp/store1234567
:b runCommand "test" { buildInputs = [ pkgs.git ]; } "chmod -R 0700 ${pkgs.git}; stat ${pkgs.git} > $out"
.... The input can be modified by the derivation:
Access: (0700/drwx------)

Expected behavior

Ultimately this is pretty expected and just how lack of priv separation works in this case (or rather doesn't). With only a single user we can't really separate derivation builds from the host uid store owner.

But maybe we can do better and at least mount input store paths readonly?

A real solution would probably be to grab throwaway uids via nsresourced (@artemist and @RaitoBezarius have much more experience with that) if it can now be used in the manner that we want.

Metadata

Additional context

Checklist


Add 👍 to issues you find important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0