Skip to content
Snippets Groups Projects
  1. Feb 26, 2013
    • Eelco Dolstra's avatar
      Security: Don't allow builders to change permissions on files they don't own · 5526a282
      Eelco Dolstra authored
      It turns out that in multi-user Nix, a builder may be able to do
      
        ln /etc/shadow $out/foo
      
      Afterwards, canonicalisePathMetaData() will be applied to $out/foo,
      causing /etc/shadow's mode to be set to 444 (readable by everybody but
      writable by nobody).  That's obviously Very Bad.
      
      Fortunately, this fails in NixOS's default configuration because
      /nix/store is a bind mount, so "ln" will fail with "Invalid
      cross-device link".  It also fails if hard-link restrictions are
      enabled, so a workaround is:
      
        echo 1 > /proc/sys/fs/protected_hardlinks
      
      The solution is to check that all files in $out are owned by the build
      user.  This means that innocuous operations like "ln
      ${pkgs.foo}/some-file $out/" are now rejected, but that already failed
      in chroot builds anyway.
      5526a282
  2. Feb 19, 2013
  3. Feb 08, 2013
  4. Feb 05, 2013
  5. Jan 30, 2013
  6. Jan 24, 2013
  7. Jan 23, 2013
  8. Jan 22, 2013
  9. Jan 21, 2013
  10. Jan 17, 2013
    • Eelco Dolstra's avatar
      Store build logs in /nix/var/log/nix/drvs/<XX> · 536c85ea
      Eelco Dolstra authored
      ...where <XX> is the first two characters of the derivation.
      Otherwise /nix/var/log/nix/drvs may become so large that we run into
      all sorts of weird filesystem limits/inefficiences.  For instance,
      ext3/ext4 filesystems will barf with "ext4_dx_add_entry:1551:
      Directory index full!" once you hit a few million files.
      536c85ea
  11. Jan 07, 2013
  12. Jan 04, 2013
  13. Jan 03, 2013
  14. Jan 02, 2013
  15. Dec 29, 2012
  16. Dec 21, 2012
  17. Dec 20, 2012
  18. Dec 19, 2012
Loading