From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YN7kBCwY0l7fZwAA0tVLHw (envelope-from ) for ; Sat, 30 May 2020 08:24:12 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id mH+wACwY0l67AgAAB5/wlQ (envelope-from ) for ; Sat, 30 May 2020 08:24:12 +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 77BC2940668 for ; Sat, 30 May 2020 08:24:11 +0000 (UTC) Received: from localhost ([::1]:57090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jewmm-0007Z8-CE for larch@yhetil.org; Sat, 30 May 2020 04:24:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jewmg-0007Yo-6Z for bug-guix@gnu.org; Sat, 30 May 2020 04:24:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45367) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jewmf-0003zL-Ti for bug-guix@gnu.org; Sat, 30 May 2020 04:24:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jewmf-0000J9-Q8 for bug-guix@gnu.org; Sat, 30 May 2020 04:24:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#41499: /proc/filesystems impurity in build environment Resent-From: Chris Marusich Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 30 May 2020 08:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41499 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 41499-submit@debbugs.gnu.org id=B41499.15908269991135 (code B ref 41499); Sat, 30 May 2020 08:24:01 +0000 Received: (at 41499) by debbugs.gnu.org; 30 May 2020 08:23:19 +0000 Received: from localhost ([127.0.0.1]:56913 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jewlz-0000IF-Jt for submit@debbugs.gnu.org; Sat, 30 May 2020 04:23:19 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:44119) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jewlx-0000Hz-V6 for 41499@debbugs.gnu.org; Sat, 30 May 2020 04:23:18 -0400 Received: by mail-pl1-f194.google.com with SMTP id bh7so2195857plb.11 for <41499@debbugs.gnu.org>; Sat, 30 May 2020 01:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=UuD9no56nPTm+bFk94rSB+k7NUM8glm/cksMK5m6fGk=; b=nmvuYeGyCn+gXhKr8TMBa9FWkTw3nV7P6CcSsLk6oQj+JdPKNckqEe9jR3HnOgffuk iOfls8F0BjlcCBM+VDI25ByJPMPvMeGPC0aW9YGiTLSmBfimUpRzliRXI6S+66tmDidm atQy+/qH7XzzsR4XNfMbk3+WGgBZXbZAIiZSa4Fi5qjgfTVrZd3gLx9RB0dYDLf4lhrM 2saQzu55JspO+eOAyg6DCqeEdbhOU2Ub8SmgiVh6Lpj7DoBOuz5TopvCujGoG9d8hugZ WSntN9jxtxNxyvwptM2flDEzo4zM1c8oNoRQiKjAofvjRJKwBaBUW5tfDYiCse1dLvhA M40Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=UuD9no56nPTm+bFk94rSB+k7NUM8glm/cksMK5m6fGk=; b=fNO9PA+EdvmZ4alvPeUDE/HBL+RnSaiwtD4dp8gUodqbuM1aGA8C0oisL02Nn4uCbb o2sQOsLLaw14dRQMDxJwssDnFGxBXLU7tbQb5j2N4avrTE5BlfTKT0WRabkqWMf2ppUA toWRZUIjh+QbglKRIQyHBPIL0cn9O2BgXtqubz++rjo46jD/HhvMA0JmUqoV17w5iZ8C 38att/RE21EfJIY02YI3RhOF4hyL9/uN1mwmK0RfWjfY4j027lUTfHcG798Cca2XTz41 6lSaz/r0fAxRcK86Pi48KyWNFOBE4KucD19ybC3yTFOWehVZqrd2HHTnOdS+hZhT6fJQ s7/g== X-Gm-Message-State: AOAM532KIMIi6iFVLLC8PI3C1D6B9BJbpOCXngTWC9DDrmgZnRXj9Rvl t6Ogkysitnr2uLF5nMkjwqiI+PJmiLE= X-Google-Smtp-Source: ABdhPJzFVRI7K5ZkaGb01mR3DQZCYzZU2UYUjrPoEaFAR4oAeooh7dA9OB8sX6n8S5Gj0QdJYxBIcQ== X-Received: by 2002:a17:90a:2e08:: with SMTP id q8mr13809231pjd.153.1590826991176; Sat, 30 May 2020 01:23:11 -0700 (PDT) Received: from garuda-lan (c-73-97-103-127.hsd1.wa.comcast.net. [73.97.103.127]) by smtp.gmail.com with ESMTPSA id mu17sm1631904pjb.53.2020.05.30.01.23.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 May 2020 01:23:10 -0700 (PDT) From: Chris Marusich References: <87v9klravp.fsf@gmail.com> <87imge3i34.fsf@gnu.org> Date: Sat, 30 May 2020 01:23:06 -0700 In-Reply-To: <87imge3i34.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Fri, 29 May 2020 16:56:47 +0200") Message-ID: <878sh9ygph.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 41499@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (rsa verify failed) header.d=gmail.com header.s=20161025 header.b=nmvuYeGy; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=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-Spam-Score: -2.01 X-TUID: cRYtot4fS0f9 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludo, Ludovic Court=C3=A8s writes: > The daemon mounts /proc in the build environment (see > libstore/build.cc): > > /* Bind a new instance of procfs on /proc to reflect our > private PID namespace. */ > createDirs(chrootRootDir + "/proc"); > if (mount("none", (chrootRootDir + "/proc").c_str(), "proc", 0, 0) = =3D=3D -1) > throw SysError("mounting /proc"); > > /proc is needed for many things on GNU/Linux. For example, libc=E2=80=99s > loader relies on /proc/self/exe to implement $ORIGIN, =E2=80=98getlogin_r= =E2=80=99 > relies on /proc/self/loginuid, =E2=80=98ttyname=E2=80=99 uses /proc/self/= fd, =E2=80=98sysconf=E2=80=99 > uses /proc/sys/kernel, etc. So we have to have /proc in there. > > The problem is that /proc appears to be all-or-nothing. > > What we could do maybe is bind-mount our own statically-defined > =E2=80=98filesystems=E2=80=99 file on top of the procfs mount above. > > There would still be many leaks in /proc anyway, so perhaps a better > approach is to patch =E2=80=98sed=E2=80=99 to not refer to it. That makes sense. I have submitted an upstream patch to fix sed: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D36150 It could be fun to investigate how far we can go with respect to limiting access in the sandbox to a minimal, uniform set of kernel features. However, unless issues like this become more common, it may not be that big of an issue. Shall we close this bug report, then? =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAl7SF+oACgkQ3UCaFdgi Rp162xAA1Mac+P41b1zAsz53GgViWR7C3EGjVc5fj76uJK5SIrKSm4IxqtFB5Kyd 5u+xyzAARLG8EGqgF0DgC9G3NCAbqUjAvm0C1a/QbrvRYi1jRsYaCFzoK5BbmA85 elgjq+x4JNPbj8jeQ1ZioyooI5I20Jqa0AGCw2JyPhqgzdotyMBRpVZg/nL/xnxP cJ6BH6fME7mx1aslOBE2UET4R02Id7lKYKRRTTDspBvTlxUTeXtB4RNbiaH3a6VB G/Dj+nRP6MVKl53Z5MoK6UIB/vY2BrBEjPpDMY1x8USDSEORO95GHagO95xzSdb1 wGO2eW85ptRJLrW0/F8XOhWvfjPcDkhlwfdmkvAFcbjub0nfquUTdezFs4/Tfcca N2sX/vjEgS2qfRengRS2tYsiVc4RtVN8oa1wjKunaD4sEbYJT0kBbta8uSQR35Ot aggvFEh1FlXARLi7cL69b6hqxVDZ969HKlsKke7N6f/vDav82t1jZZ2TLXQXBh1l Gm+Fj+zbkM8SM6/KaxlWq5r4Rd57BKj1sd4OownpqaPPC6gtjwaMsdCejg/zj0qd SqytN91+R9ijQyA10sMQOZjp7AXvmOYCqPHSBIGeswPTOIl7+B7GsP+vTJiGxd+i nRz2Xgge5A/g2Do8OOgFg0lRBkjZ3kfu3+pmfZh9zAoi+XerQa8= =JnX7 -----END PGP SIGNATURE----- --=-=-=--