about summary refs log tree commit diff
path: root/pkgs/applications/virtualization/virtualbox/hardened.patch
AgeCommit message (Collapse)AuthorFilesLines
2023-05-19virtualbox: 7.0.6 -> 7.0.8Alexandre Iooss1-29/+29
2021-10-30virtualbox: 6.1.26 -> 6.1.28Bernardo Meurer1-61/+60
2020-03-13virtualbox: 6.0.14 -> 6.1.4Matteo Scarlata1-26/+26
Update Virtualbox to its latest version. This allows compilation against kernel >= 5.4 to succeed without further patches (see #74260, build would fail for linux-5.5.5 to 5.5.9).
2017-11-15virtualbox: 5.1.26 -> 5.2.0Tim Steinbach1-13/+13
2017-06-23virtualbox: Rebase hardened.patch on top of 5.1.22aszlig1-31/+19
The merge of the version bump in 6fb9f892382b4b091fc9edcae00e2eb4c0729bda didn't take care of our patch for the hardening mode and thus enabling VirtualBox without also force-disabling hardening mode will result in a build error. While the patch is largely identical with the old version, I've removed one particular change around the following code: if (pFsObjState->Stat.st_mode & S_IWOTH) return supR3HardenedSetError3(VERR_SUPLIB_WORLD_WRITABLE, pErrInfo, "World writable: '", pszPath, "'"); In the old version of the patch we have checked whether the path is within the Nix store and suppressed the error return if that's the case. The reason why I did that in the first place was because we had a bunch of symlinks which were writable. In VirtualBox 5.1.22 the code specifically checks whether the file is a symlink, so we can safely drop our change. Tested via all of the "virtualbox" NixOS VM subtests and they now all succeed. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2017-01-29Getting rid of the var indirection and using a bin path insteadParnell Springmeyer1-3/+3
2017-01-28Addressing PR feedbackParnell Springmeyer1-3/+3
2016-09-01Adapting everything for the merged permissions wrappers work.Parnell Springmeyer1-3/+3
2015-05-15virtualbox+guest: Update to new version 4.3.28.aszlig1-13/+0
Contains quite a lot of fixes, so for information and details about them, please have a look at https://www.virtualbox.org/wiki/Changelog. We also needed to drop the hunk about NATNetworkServiceRunner.cpp in the hardened.patch, because the file was unused and thus has been removed from upstream in r54821: https://www.virtualbox.org/changeset?reponame=vbox&new=54821 Tested successfully against nixos/tests/virtualbox.nix. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2015-04-04virtualbox: Remove group check on /nix/store.aszlig1-4/+6
This is espacially cruicial when it comes to Nix 1.9, where we even have a more restrictive /nix/store. In any event, VirtualBox in hardenend mode doesn't have to check the /nix/store path, because it's read-only on NixOS systems. So this check would not introduce more security but more hurdles, thus I'm removing it (of course _only_ for /nix/store). Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-12-18virtualbox: Fix runtime paths in hardening mode.aszlig1-0/+166
Because we have to rely on setuid wrappers on NixOS, we can't easily hardcode the executable paths and set it 4755. So for all calls, we need to change the runtime path executable directory to /var/setuid-wrappers/ and for verification we need to retain the executable directory. Also note, that usually VBoxNetAdpCtl, VBoxNetDHCP, VBoxNetNAT, VBoxSDL and VBoxVolInfo don't reside in directories that are commonly in PATH, but in /usr/lib/virtualbox in most mainstream distros. But because the names of these executables are distinctive enough to not cause collisions with other setuid programs, I'll leave it like that and not patch up setuid-wrappers. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-11-30virtualbox: Allow /nix/store being world-writable.aszlig1-1/+14
We are already checking whether /nix/store has the sticky bit set, so if it is world-writable as well it doesn't mean that the actual store path is writable. Let alone the fact that it is only writable during the build process. This should fix installing the extension pack when enableExtensionPack is used. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-11-29virtualbox: Enable hardening by default.aszlig1-0/+26
VirtualBox with hardening support requires the main binaries to be setuid root. Using VBOX_WITH_RUNPATH, we ensure that the RPATHs are pointing to the libexec directory and we also need to unset VBOX_WITH_ORIGIN to make sure that the build system is actually setting those RPATHs. The hardened.patch implements two things: * Set the binary directory to the setuid-wrappers dir so that VboxSVC calls them instead of the binaries from the store path. The reason behind this is because nothing in the Nix store can have the setuid flag. * Excempt /nix/store from the group permission check, because while it is group-writeable indeed it also has the sticky bit set (and also the whole store is mounted read-only on most NixOS systems), so we're checking on that as well. Right now, the hardened.patch uses /nix/store and /var/setuid-wrappers directly, so someone would ever want to change those on a NixOS system, please provide a patch to set those paths on build time. However, for simplicity, it's best to do it when we _really_ need it. Signed-off-by: aszlig <aszlig@redmoonstudios.org>