From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id pET9JiLwdWBOEgAAgWs5BA (envelope-from ) for ; Tue, 13 Apr 2021 21:25:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id yHPHHyLwdWC2NQAA1q6Kng (envelope-from ) for ; Tue, 13 Apr 2021 19:25:22 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C317619CC8 for ; Tue, 13 Apr 2021 21:25:21 +0200 (CEST) Received: from localhost ([::1]:43766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lWOf2-0002kr-Fh for larch@yhetil.org; Tue, 13 Apr 2021 15:25:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lWOek-0002kg-43 for bug-guix@gnu.org; Tue, 13 Apr 2021 15:25:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49309) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lWOej-0002nN-Rm for bug-guix@gnu.org; Tue, 13 Apr 2021 15:25:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lWOej-0004uH-N7 for bug-guix@gnu.org; Tue, 13 Apr 2021 15:25:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#47628: webkitgtk-2.32.0 fails to launch without /usr/bin Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 13 Apr 2021 19:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47628 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Efraim Flashner Received: via spool by 47628-submit@debbugs.gnu.org id=B47628.161834187918829 (code B ref 47628); Tue, 13 Apr 2021 19:25:01 +0000 Received: (at 47628) by debbugs.gnu.org; 13 Apr 2021 19:24:39 +0000 Received: from localhost ([127.0.0.1]:60855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWOeM-0004td-Kx for submit@debbugs.gnu.org; Tue, 13 Apr 2021 15:24:39 -0400 Received: from world.peace.net ([64.112.178.59]:35572) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lWOeL-0004tQ-5v for 47628@debbugs.gnu.org; Tue, 13 Apr 2021 15:24:37 -0400 Received: from mhw by world.peace.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lWOeE-000121-81; Tue, 13 Apr 2021 15:24:30 -0400 From: Mark H Weaver In-Reply-To: References: <87tuojni9a.fsf@netris.org> <87r1jnnhfi.fsf@netris.org> <87lf9upmwb.fsf@yamatai> <87h7kgoo2z.fsf@netris.org> <87blaoonha.fsf@netris.org> <878s5solv5.fsf@netris.org> Date: Tue, 13 Apr 2021 15:22:47 -0400 Message-ID: <87mtu2rntp.fsf@netris.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 47628@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1618341921; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=uh9QON7OsunjWrsEcdhzEUluq6a06feL13Lf5CP4u+4=; b=l2rUALIT538cTiVBgYCmaxlLNEM0od1kYvg1sPSm6UkNOk81WWUVwp4Nc2Xrj0PSP1vhFS WqF7nLnab2QKQToAcK4/i9grOCskmsmlZWDK6sgx7A6Se0pQSnYidTt1Juj8HSKFIDRc4D wiwO/lheZdfnuL4AU2CudoczINEQrqX0qwZDgDcvAaQTN3RHCqUgVoyXxwd9NgmsEbs/9R 0bTJ5hZgC4rNDYB5QrBDDbIh4pZluwGYKPD/stOcx+saOrZzLlC0Fw9cK9PX7nPRh6e42r 49/jVY0CqLH+UqYV8ciClnxrS1Tlh5aHZhvGVBEAm2WN97BeQcZW4CdgucuM2g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618341921; a=rsa-sha256; cv=none; b=OP6/t8fA9S2KfEO9hhuuR/mK8JVKFQLBQ1wgwJP0Km7XIRyHb0KLmV2OJlShcfyHym/wCZ nCnssg3F+olk/7BNcXoICe27FrBfgpjXEE59PRAt8D/Ml1M6p1WfiErVOCV1iRLT1BBPuh jHAnO1w0SIwTh3+HhTBUEuf0egTka50swSDpoeQZ7IxlPln1rQCPZUJtHdiuprKZSHmAHL lMahiwGIVhWwunH5nZKlPFndQQgcAlmRV6PdeuqFbx2hUEvW69FvoGUpqIWkKmOUNSmEqI SUv2SOD6o0Olbt6q1ox9PqzDg+Ek/zkKu6Xb1slMHYSNs/G9dcJaoJ+ICTlQIw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: -0.13 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: C317619CC8 X-Spam-Score: -0.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: P/un8DnctEn4 --=-=-= Content-Type: text/plain Hi Efraim, Efraim Flashner writes: > On Thu, Apr 08, 2021 at 11:07:31AM -0400, Mark H Weaver wrote: >> I suspect that the relevant bit that needs to be changed is line 779 of >> the following file in the webkitgtk-2.32.0 source code: >> >> Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp >> >> Most likely, that line can simply be deleted. Here's the relevant >> excerpt, with line 779 marked by "==>": > > Looking at the other lines above it, we could just change it from > ro-bind to ro-bind-try. I expect that would work, but why should we give the sandbox access to /usr/bin at all? I took a different approach: I removed access to *all* of the FHS directories, since they should not be needed for a Guix-compiled package. Below, I've attached the patch that I'm currently using successfully on my private branch of Guix. What do you think? Thanks, Mark --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-DRAFT-gnu-webkitgtk-Trim-system-dirs-made-available-.patch Content-Description: [PATCH] DRAFT: gnu: webkitgtk: Trim system dirs made available to sandbox. >From 4a10e1deb63d1b2227a0bcc60a17ddb9af7b8cc3 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Thu, 8 Apr 2021 11:27:55 -0400 Subject: [PATCH] DRAFT: gnu: webkitgtk: Trim system dirs made available to sandbox. * gnu/packages/patches/webkitgtk-share-store.patch: Adjust patch. --- .../patches/webkitgtk-share-store.patch | 46 ++++++++++++++----- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/gnu/packages/patches/webkitgtk-share-store.patch b/gnu/packages/patches/webkitgtk-share-store.patch index 053d86fcf4..c02157076e 100644 --- a/gnu/packages/patches/webkitgtk-share-store.patch +++ b/gnu/packages/patches/webkitgtk-share-store.patch @@ -1,19 +1,41 @@ -Tell bubblewrap to share the store. Required for programs that use the +Tell bubblewrap to share the store, and _not_ to share traditional FHS +directories that are not used in Guix. Required for programs that use the sandboxing features such as Epiphany. -See . -Author: Jack Hill ---- +See and . +Authors: Jack Hill and Mark H Weaver . + diff --git a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp --- a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp +++ b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp -@@ -737,6 +737,9 @@ GRefPtr bubblewrapSpawn(GSubprocessLauncher* launcher, const Proces - "--ro-bind-try", "/usr/local/share", "/usr/local/share", +@@ -749,26 +749,18 @@ + "--ro-bind", "/sys/dev", "/sys/dev", + "--ro-bind", "/sys/devices", "/sys/devices", + +- "--ro-bind-try", "/usr/share", "/usr/share", +- "--ro-bind-try", "/usr/local/share", "/usr/local/share", "--ro-bind-try", DATADIR, DATADIR, -+ // Bind mount the store inside the WebKitGTK sandbox. -+ "--ro-bind", "@storedir@", "@storedir@", -+ - // We only grant access to the libdirs webkit is built with and - // guess system libdirs. This will always have some edge cases. - "--ro-bind-try", "/lib", "/lib", +- // We only grant access to the libdirs webkit is built with and +- // guess system libdirs. This will always have some edge cases. +- "--ro-bind-try", "/lib", "/lib", +- "--ro-bind-try", "/usr/lib", "/usr/lib", +- "--ro-bind-try", "/usr/local/lib", "/usr/local/lib", +- "--ro-bind-try", LIBDIR, LIBDIR, +- "--ro-bind-try", "/lib64", "/lib64", +- "--ro-bind-try", "/usr/lib64", "/usr/lib64", +- "--ro-bind-try", "/usr/local/lib64", "/usr/local/lib64", ++ // Bind mount the store inside the WebKitGTK sandbox. ++ "--ro-bind", "@storedir@", "@storedir@", + ++ // We only grant access to the libdirs webkit is built with. ++ "--ro-bind-try", LIBDIR, LIBDIR, + "--ro-bind-try", PKGLIBEXECDIR, PKGLIBEXECDIR, + }; + + if (launchOptions.processType == ProcessLauncher::ProcessType::DBusProxy) { + sandboxArgs.appendVector(Vector({ +- "--ro-bind", "/usr/bin", "/usr/bin", + // This is a lot of access, but xdg-dbus-proxy is trusted so that's OK. It's sandboxed + // only because we have to mount .flatpak-info in its mount namespace. The user rundir + // is where we mount our proxy socket. -- 2.31.1 --=-=-=--