From 4823d1bf38a937f0d7482bd399e0e535681e48c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Wed, 9 Aug 2023 01:24:40 +0200 Subject: [PATCH] tor-browser-bundle-bin: deprecate useHardenedMalloc Set useHardenedMalloc to false by default & add deprecation warning. graphene-hardened-malloc cannot fully replace Tor Browser's statically linked jemalloc & can cause issues. --- .../browsers/tor-browser-bundle-bin/default.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix b/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix index ee31f79a5752..4cece29ef949 100644 --- a/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix +++ b/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix @@ -47,7 +47,7 @@ # Hardening , graphene-hardened-malloc # Whether to use graphene-hardened-malloc -, useHardenedMalloc ? true +, useHardenedMalloc ? null # Whether to disable multiprocess support , disableContentSandbox ? false @@ -56,7 +56,10 @@ , extraPrefs ? "" }: -let +lib.warnIf (useHardenedMalloc != null) + "tor-browser-bundle-bin: useHardenedMalloc is deprecated and enabling it can cause issues" + +(let libPath = lib.makeLibraryPath libPkgs; libPkgs = [ @@ -268,7 +271,7 @@ stdenv.mkDerivation rec { GeoIPv6File $TBB_IN_STORE/TorBrowser/Data/Tor/geoip6 EOF - WRAPPER_LD_PRELOAD=${lib.optionalString useHardenedMalloc + WRAPPER_LD_PRELOAD=${lib.optionalString (useHardenedMalloc == true) "${graphene-hardened-malloc}/lib/libhardened_malloc.so"} WRAPPER_XDG_DATA_DIRS=${lib.concatMapStringsSep ":" (x: "${x}/share") [ @@ -477,4 +480,4 @@ stdenv.mkDerivation rec { license = licenses.free; sourceProvenance = with sourceTypes; [ binaryNativeCode ]; }; -} +})