From patchwork Wed Jul 24 05:44:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Domnitskii X-Patchwork-Id: 29521 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 38A3E27BBE9; Wed, 24 Jul 2024 06:46:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2A9E727BBE2 for ; Wed, 24 Jul 2024 06:46:11 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sWUp4-0000kI-6F; Wed, 24 Jul 2024 01:45:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWUp3-0000im-BI for guix-patches@gnu.org; Wed, 24 Jul 2024 01:45:57 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sWUp2-0007Uj-VT for guix-patches@gnu.org; Wed, 24 Jul 2024 01:45:57 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sWUp8-00073a-Au for guix-patches@gnu.org; Wed, 24 Jul 2024 01:46:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72265] [PATCH 1/1] gnu: librewolf: Add guix drivers paths to RDD whitelist Resent-From: Nikita Domnitskii Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 24 Jul 2024 05:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72265 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72265@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172179990527050 (code B ref -1); Wed, 24 Jul 2024 05:46:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Jul 2024 05:45:05 +0000 Received: from localhost ([127.0.0.1]:33010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWUoD-00072E-Fh for submit@debbugs.gnu.org; Wed, 24 Jul 2024 01:45:05 -0400 Received: from lists.gnu.org ([209.51.188.17]:33464) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sWUoC-000727-Bo for submit@debbugs.gnu.org; Wed, 24 Jul 2024 01:45:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWUo6-0000C2-M6 for guix-patches@gnu.org; Wed, 24 Jul 2024 01:44:58 -0400 Received: from out-177.mta0.migadu.com ([2001:41d0:1004:224b::b1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sWUo4-00078X-Lp for guix-patches@gnu.org; Wed, 24 Jul 2024 01:44:58 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=domnitskii.me; s=key1; t=1721799894; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QnKqVbHDMPRRifNhGJmyUx0IqDbJqyt0ndTXJ+k4bQg=; b=dv+WswKSfQN1WANAruPkB4CK/Sgj5IvcyN24SE6rtonQpCbEpb8K13BFzyZmWnhDWDHC7p 4NN9dcJhqpRHv+erun+WJZaozAlHkMJhNJFgggCcohfOp8Jktl+fb1qeQqRPdsk1DyNOKd 48JCuLRTPVFJr5I/T4cM9sH40IyumzQ= In-Reply-To: References: Message-Id: Date: Wed, 24 Jul 2024 11:44:51 +0600 MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:1004:224b::b1; envelope-from=nikita@domnitskii.me; helo=out-177.mta0.migadu.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nikita Domnitskii X-ACL-Warn: , Nikita Domnitskii via Guix-patches X-Patchwork-Original-From: Nikita Domnitskii via Guix-patches via From: Nikita Domnitskii Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Change-Id: I5aaf590b625dfbacb19b6dc54d7f83f73bea1fda --- gnu/packages/librewolf.scm | 20 ++++--------------- ...librewolf-add-paths-to-rdd-whitelist.patch | 11 ++++++++++ 2 files changed, 15 insertions(+), 16 deletions(-) create mode 100644 gnu/packages/patches/librewolf-add-paths-to-rdd-whitelist.patch diff --git a/gnu/packages/librewolf.scm b/gnu/packages/librewolf.scm index 3e46477724..b34e29d9db 100644 --- a/gnu/packages/librewolf.scm +++ b/gnu/packages/librewolf.scm @@ -203,7 +203,9 @@ (define librewolf-source (invoke "make" "all") (copy-file (string-append "librewolf-" #$version ".source.tar.gz") - #$output)))))))) + #$output))))) + (patches + (search-patches "librewolf-add-paths-to-rdd-whitelist.patch"))))) ;; Define the versions of rust needed to build librewolf, trying to match ;; upstream. See the file taskcluster/ci/toolchain/rust.yml at @@ -573,26 +575,12 @@ (define-public librewolf ;; For U2F and WebAuthn "eudev"))) - ;; VA-API is run in the RDD (Remote Data Decoder) sandbox - ;; and must be explicitly given access to files it needs. - ;; Rather than adding the whole store (as Nix had - ;; upstream do, see - ;; and - ;; linked upstream patches), we can just follow the - ;; runpaths of the needed libraries to add everything to - ;; LD_LIBRARY_PATH. These will then be accessible in the - ;; RDD sandbox. - (rdd-whitelist (map (cut string-append <> "/") - (delete-duplicates (append-map - runpaths-of-input - '("mesa" - "ffmpeg"))))) (gtk-share (string-append (assoc-ref inputs "gtk+") "/share"))) (wrap-program (car (find-files lib "^librewolf$")) `("LD_LIBRARY_PATH" prefix - (,@libs ,@rdd-whitelist)) + (,@libs)) `("XDG_DATA_DIRS" prefix (,gtk-share)) `("MOZ_LEGACY_PROFILES" = diff --git a/gnu/packages/patches/librewolf-add-paths-to-rdd-whitelist.patch b/gnu/packages/patches/librewolf-add-paths-to-rdd-whitelist.patch new file mode 100644 index 0000000000..1bee0bddf5 --- /dev/null +++ b/gnu/packages/patches/librewolf-add-paths-to-rdd-whitelist.patch @@ -0,0 +1,11 @@ +--- a/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp ++++ b/security/sandbox/linux/broker/SandboxBrokerPolicyFactory.cpp +@@ -920,6 +920,8 @@ + policy->AddDir(rdonly, "/usr/lib64"); + policy->AddDir(rdonly, "/run/opengl-driver/lib"); + policy->AddDir(rdonly, "/nix/store"); ++ policy->AddDir(rdonly, "/gnu/store"); ++ policy->AddDir(rdonly, "/run/current-system/profile/lib"); + + // Bug 1647957: memory reporting. + AddMemoryReporting(policy.get(), aPid);