From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uMUUNpiy72LjtAAAbAwnHQ (envelope-from ) for ; Sun, 07 Aug 2022 14:39:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id IEv1NZiy72IvUgAAauVa8A (envelope-from ) for ; Sun, 07 Aug 2022 14:39:52 +0200 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 B481646B37 for ; Sun, 7 Aug 2022 14:39:52 +0200 (CEST) Received: from localhost ([::1]:35608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oKfZP-0005qm-To for larch@yhetil.org; Sun, 07 Aug 2022 08:39:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oKPuw-00052t-VM for bug-guix@gnu.org; Sat, 06 Aug 2022 15:57:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45723) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oKPuw-00043O-Ll for bug-guix@gnu.org; Sat, 06 Aug 2022 15:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oKPuw-00041h-FB for bug-guix@gnu.org; Sat, 06 Aug 2022 15:57:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#50916: Experimental `guix container PID program args` not working as expected References: <865yuif8go.fsf@bonfacemunyoki.com> Resent-From: kiasoc5 Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 06 Aug 2022 19:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50916 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: me@bonfacemunyoki.com, 50916@debbugs.gnu.org Received: via spool by 50916-submit@debbugs.gnu.org id=B50916.165981579815448 (code B ref 50916); Sat, 06 Aug 2022 19:57:02 +0000 Received: (at 50916) by debbugs.gnu.org; 6 Aug 2022 19:56:38 +0000 Received: from localhost ([127.0.0.1]:35472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKPuY-000416-CM for submit@debbugs.gnu.org; Sat, 06 Aug 2022 15:56:38 -0400 Received: from knopi.disroot.org ([178.21.23.139]:50292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKPuV-00040v-Jz for 50916@debbugs.gnu.org; Sat, 06 Aug 2022 15:56:36 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 25DC640F0F; Sat, 6 Aug 2022 21:56:34 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LM1jIPIvuQg1; Sat, 6 Aug 2022 21:56:33 +0200 (CEST) Date: Sat, 6 Aug 2022 19:56:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1659815793; bh=04WQ1iG3aSFODdGsVSb6eZTj4W8mYvckQyCz1CEYyrc=; h=Date:From:To:Subject:In-Reply-To; b=IWceFgqn17onlxmsVTgdR3dWroNW90y5X6Kb+BrBbA7rmcOxBMW7hZWNwRb9UdBmO ofRODKZPvldM8uR8Vi55aVHUiPk/SEP0PvsGky7MLxqc7cZDbiTphy9JziDAAqT9Tz c70NvqRKJPEcCknR5IPkBXPkXFFB9mfLh/vKxQmmcjGmNapFq8C7ch+i6oss1cHld1 4Mvu2EpKXrAtl9VBDidkdtxgdSC6Gz8wP7wolMdaJ8nHoHAAg7W4BioMl3Eg/ux71K bZieRCSP9QaM1IxKWT5V5ZTXzTl6qFvfYe4Zgf4ALF5hMAml9EvxgYSx+WNacu2T8g wAbLYJ6pmSVig== From: kiasoc5 Message-ID: <20220806195629.054aef70@aria> In-Reply-To: 865yuif8go.fsf@bonfacemunyoki.com Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sun, 07 Aug 2022 08:39:42 -0400 X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1659875992; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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:dkim-signature; bh=KX5h9cb6Vdg8JDsl9wOmFMLbpMEB+3kl87vKXIuMOQQ=; b=FczaA+rGVgwXWTBAKunW4LVs5/U/ECtFGe6Z+IZ3C1oPtkCiYKTxVFfgKohMpgzq4b10ao RV3C24PI6dcYobTGk+g2okle+uihFcSEjLoIP6ml1hQFczfaZyTJ84hzxj/Hlr2hJZVCu6 9vCU/s8BJoI/5ic52Q+C9YfbLza0o2bvC/j2ml+GlK7K9tjDmIwiCcEzW7laWA68mTAzgD ML3yR/9wSPUrVAmHRnoTECtaGYXYwwiGq+LGxy3LYGjw51HOE4WScOESXpup4VDjFujU7R /tG0zmUdgw8YnAW8bjAQrRogjomNMD06BVZKLC4FCnQz2sEYAztCZe+oR/An1A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1659875992; a=rsa-sha256; cv=none; b=UHRDK30VIzkwmfas+kD6hEQSsb/qbQhfO28kmmLEtg/hlSm5XbuZsk6L2usE6eUzaleOw8 +W9l+rv2uDqaLhdwWPYkEr9E5k75HTgStJ1V21xVeTVJMlnB7RKapO3T1HwdZKqqVkAd6v kIpqNWJFlJU4C3zD7VZ5Ncl9Ig8AHwi0mIvFirZwvoqmOleagpXrdqK/ZFZcpSFZUvXtAD xeJIXp5DXpPvB+zwqJJZoQ5lvYrqAC00dpLHqNAF2qvybHO6gDoKF06foKWCQoA6vQDtjV UrN6y66rhw25W2AXiFG4p26YT7EhFeU4hbT+c5Zp6g74DXr6rQhZzoZFWoPO1w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=IWceFgqn; dmarc=pass (policy=quarantine) header.from=disroot.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.09 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=disroot.org header.s=mail header.b=IWceFgqn; dmarc=pass (policy=quarantine) header.from=disroot.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: B481646B37 X-Spam-Score: -3.09 X-Migadu-Scanner: scn1.migadu.com X-TUID: p2dkXt2uVSym This bug still persists and effectively bypasses container sandboxing: 1. Start a container shell. $ guix shell --container 2. Exec a shell inside the container. Here it is a foreign distro's bash, and assume that there is only 1 container running. $ guix container exec $(pgrep --full 'guix shell --container') /bin/bash 3. Observe that path is not empty. $ echo $PATH /usr/local/sbin:/usr/local/bin:/usr/bin This shell can access commands outside the container, such as kill (part of util-linux). 4. Kill the container from the shell inside the container. [env] $ kill -9 $(pgrep --full 'guix shell --container') [env] $ echo $? 0 The shell still persists in the container, even though the container itself is killed. The problem is that in guix/scripts/container/exec.scm, execlp is used to launch program with args. info guile says this about execlp: Similar to =E2=80=98execl=E2=80=99, however if FILENAME does not contain = a slash then the file to execute will be located by searching the directories listed in the =E2=80=98PATH=E2=80=99 environment variable. As seen above $PATH is set to a subset of the host system's PATH, not the PATH inside the guix container.