Skip to content
Snippets Groups Projects
  1. Apr 26, 2013
  2. Apr 23, 2013
  3. Apr 09, 2013
  4. Apr 04, 2013
  5. Mar 25, 2013
    • Eelco Dolstra's avatar
      Fix evaluation of the VM tests · 23984178
      Eelco Dolstra authored
      23984178
    • Shea Levy's avatar
      makeStoreWritable: Ask forgiveness, not permission · cc63db1d
      Shea Levy authored
      It is surprisingly impossible to check if a mountpoint is a bind mount
      on Linux, and in my previous commit I forgot to check if /nix/store was
      even a mountpoint at all. statvfs.f_flag is not populated with MS_BIND
      (and even if it were, my check was wrong in the previous commit).
      
      Luckily, the semantics of mount with MS_REMOUNT | MS_BIND make both
      checks unnecessary: if /nix/store is not a mountpoint, then mount will
      fail with EINVAL, and if /nix/store is not a bind-mount, then it will
      not be made writable. Thus, if /nix/store is not a mountpoint, we fail
      immediately (since we don't know how to make it writable), and if
      /nix/store IS a mountpoint but not a bind-mount, we fail at first write
      (see below for why we can't check and fail immediately).
      
      Note that, due to what is IMO buggy behavior in Linux, calling mount
      with MS_REMOUNT | MS_BIND on a non-bind readonly mount makes the
      mountpoint appear writable in two places: In the sixth (but not the
      10th!) column of mountinfo, and in the f_flags member of struct statfs.
      All other syscalls behave as if the mount point were still readonly (at
      least for Linux 3.9-rc1, but I don't think this has changed recently or
      is expected to soon). My preferred semantics would be for MS_REMOUNT |
      MS_BIND to fail on a non-bind mount, as it doesn't make sense to remount
      a non bind-mount as a bind mount.
      cc63db1d
    • Shea Levy's avatar
      makeStoreWritable: Use statvfs instead of /proc/self/mountinfo to find out if... · 2c9cf507
      Shea Levy authored
      makeStoreWritable: Use statvfs instead of /proc/self/mountinfo to find out if /nix/store is a read-only bind mount
      
      /nix/store could be a read-only bind mount even if it is / in its own filesystem, so checking the 4th field in mountinfo is insufficient.
      
      Signed-off-by: default avatarShea Levy <shea@shealevy.com>
      2c9cf507
  6. Mar 18, 2013
  7. Mar 15, 2013
  8. Mar 14, 2013
  9. Mar 08, 2013
  10. Mar 07, 2013
  11. Feb 28, 2013
  12. Feb 27, 2013
  13. Feb 26, 2013
    • Eelco Dolstra's avatar
      Remove outdated file · 826dc0d0
      Eelco Dolstra authored
      826dc0d0
    • Eelco Dolstra's avatar
      Bump version number · 97c6009c
      Eelco Dolstra authored
      97c6009c
    • Eelco Dolstra's avatar
      Update release notes · ca9c02df
      Eelco Dolstra authored
    • 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
  14. Feb 19, 2013
  15. Feb 08, 2013
Loading