guix-mirrors/gnu/packages/patches/torbrowsers-add-store-to-rdd-allowlist.patch
André Batista 17cdf44ba1
gnu: make-torbrowser: Remove redundant phase.
Follow up to commit 6ee9cd170b which added
torbrowsers-add-store-to-rdd-allowlist.patch and implicitly made
'build-sandbox-whitelist phase unnecessary.

Users are encouraged to use Guix Containers if they want to restrict
browsers' access to their file systems.

* gnu/packages/tor-browsers.scm (make-torbrowser) [arguments] <#:phases>
'build-sandbox-whitelist: Remove it;
'autoconfig: Remove step that adds the forementioned list to browser
default preferences.
* gnu/packages/patches/torbrowsers-add-store-to-rdd-allowlist.patch: Add
explanatory comment and refer to issues this patch addresses.

Change-Id: Icc0ea4c2470e8bc82e3a2bf57966b46fd47a7cf8
Signed-off-by: Hilton Chain <hako@ultrarare.space>
2025-08-12 22:07:04 +08:00

51 lines
2.2 KiB
Diff

By default Firefox sandbox security model allows browser components to
access files under '/usr', '/etc' and user home directories. However,
similar to Nix, on Guix some of those file hierarchies are actually
symlinks to '/gnu/store' paths, which then get denied, breaking some
expected functionality on the browser. Moreover, their final store
paths are not available on the build environment and also expected to
change.
Guix users that are willing to further restrict browsers' access to their
file systems and do not mind losing some funcionality are advised to use
Guix Containers.
See: <https://bugzilla.mozilla.org/show_bug.cgi?id=1848615#c8>,
<https://codeberg.org/guix/guix/issues/661>,
<https://issues.guix.gnu.org/38045> and
<https://issues.guix.gnu.org/77559>
--- a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
+++ b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp
@@ -452,6 +452,7 @@
// Various places where fonts reside
policy->AddDir(rdonly, "/usr/X11R6/lib/X11/fonts");
policy->AddDir(rdonly, "/nix/store");
+ policy->AddDir(rdonly, "/gnu/store");
// https://gitlab.com/freedesktop-sdk/freedesktop-sdk/-/blob/e434e680d22260f277f4a30ec4660ed32b591d16/files/fontconfig-flatpak.conf
policy->AddDir(rdonly, "/run/host/fonts");
policy->AddDir(rdonly, "/run/host/user-fonts");
@@ -461,6 +462,7 @@
// Bug 1848615
policy->AddPath(rdonly, "/usr");
policy->AddPath(rdonly, "/nix");
+ policy->AddPath(rdonly, "/gnu");
AddLdconfigPaths(policy);
AddLdLibraryEnvPaths(policy);
@@ -920,6 +922,7 @@
policy->AddDir(rdonly, "/usr/lib64");
policy->AddDir(rdonly, "/run/opengl-driver/lib");
policy->AddDir(rdonly, "/nix/store");
+ policy->AddDir(rdonly, "/gnu/store");
// Bug 1647957: memory reporting.
AddMemoryReporting(policy.get(), aPid);
@@ -1043,6 +1046,7 @@
// Required to make sure ffmpeg loads properly, this is already existing on
// Content and RDD
policy->AddDir(rdonly, "/nix/store");
+ policy->AddDir(rdonly, "/gnu/store");
// glibc will try to stat64("/") while populating nsswitch database
// https://sourceware.org/git/?p=glibc.git;a=blob;f=nss/nss_database.c;h=cf0306adc47f12d9bc761ab1b013629f4482b7e6;hb=9826b03b747b841f5fc6de2054bf1ef3f5c4bdf3#l396