From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id KIO4MqRbaGITfQAAbAwnHQ (envelope-from ) for ; Tue, 26 Apr 2022 22:52:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id kJnpMqRbaGIgZQEA9RJhRA (envelope-from ) for ; Tue, 26 Apr 2022 22:52: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 752F612BA6 for ; Tue, 26 Apr 2022 22:52:52 +0200 (CEST) Received: from localhost ([::1]:50160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1njSB1-00043w-K9 for larch@yhetil.org; Tue, 26 Apr 2022 16:52:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49614) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njS7K-0007JD-Q9 for guix-patches@gnu.org; Tue, 26 Apr 2022 16:49:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46753) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1njS7K-0004ho-Gz for guix-patches@gnu.org; Tue, 26 Apr 2022 16:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1njS7K-0000bF-BE for guix-patches@gnu.org; Tue, 26 Apr 2022 16:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54997] [PATCH 00/12] Add "least authority" program wrapper Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 Apr 2022 20:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54997 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Thiago Jung Bauermann Cc: 54997@debbugs.gnu.org Received: via spool by 54997-submit@debbugs.gnu.org id=B54997.16510061102258 (code B ref 54997); Tue, 26 Apr 2022 20:49:02 +0000 Received: (at 54997) by debbugs.gnu.org; 26 Apr 2022 20:48:30 +0000 Received: from localhost ([127.0.0.1]:40649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njS6o-0000aM-0S for submit@debbugs.gnu.org; Tue, 26 Apr 2022 16:48:30 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1njS6l-0000a7-9l for 54997@debbugs.gnu.org; Tue, 26 Apr 2022 16:48:28 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njS6f-0004d3-CK; Tue, 26 Apr 2022 16:48:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=jY17lDhsRlthgcItRdb8bxbMJ5wb0sPCcrF/e3EatHU=; b=gE8DW4zwffVDstMdJ8Od z0hM6S2J6h4iV6lev3sjwQoZCTMeEKGxaQkiGxU/XC7VRNabOq1DG/dh/JAUPIMZYH6vHWh+Lzyen DZQH6y4IZNJUeFSlESB9VLLM6BQ/T4gJiXBwI/K8b/PrmLCR1GRT+uHGyHkyU9opTf3FPxusrIn4j DEPXRik0D1MRv8ZNtX8SBDT4buw9PwVEGgTt6EX6a04nqrWhj9cGKUo0B+CT0U4mQ8yphH03NixcT 74IDwJqWFt9vmitvybDvInvIHiThEnTHSm+ULvNkqKX1Wa8VudOTPV7TcDc4ZCXwf7AuFFrVqq8sd ecchqQFQcHZWXg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:50952 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1njS6e-0003sA-Vd; Tue, 26 Apr 2022 16:48:21 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20220417210453.27884-1-ludo@gnu.org> <20220417210453.27884-4-ludo@gnu.org> <87h76klv6j.fsf@kolabnow.com> Date: Tue, 26 Apr 2022 22:48:18 +0200 In-Reply-To: <87h76klv6j.fsf@kolabnow.com> (Thiago Jung Bauermann's message of "Fri, 22 Apr 2022 17:10:19 -0300") Message-ID: <878rrrk1v1.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) 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-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" 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=1651006372; 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: 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=jY17lDhsRlthgcItRdb8bxbMJ5wb0sPCcrF/e3EatHU=; b=LeJ5tcHLqcJH+EL05F5YmuOaTtkkT4VrDm/6hl9pv2oaRzXOPbGWLK3vvqtpsuCnMBlAfo FOrr+Zggt8oID5bNlp3JlXdqwaUsLc+Bx6BkPnHFtuhCnjTSYjjH8QXhFNYDig2x6cIh1W yvus8T8G6KIVhU9msm+Pjk7ZzduGkeCkC8I9b/sWFvG5jp94gbuyAxy7boRN12u3NJvj0Z 4csAdJZtrxHOg8Ux7IM1rBF2uxzjqO2JE8u42XQJH9ATzALGbr+3uTpF21IyKyxu4FQrpO etORA87sF3EUzRNrZh7l5PAr7SOCypR25eIKW+alRhteWUO6yZ8ZmnQe7iCeVg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651006372; a=rsa-sha256; cv=none; b=ewdhAuGG7+l1Tl/4yz70DIgHxMn45bBdRSTWV1gBVatrtK75YP7IT/HNfydVWz2ExLgAZ/ p2EInILWiEp5gdRwKJ1Iq4Hhx/DeRMwjug3innCnZmxbVvQs+LXVEyflHYW3c/Ig3yoUHO onBNtspIYD/WNPneomya+cXsHHcszDGnWnrm3+r+YoPU36EkS9gOJkQrDa5MMneC0dQggy EnShQncUSFAovSaznYeHRlzk5sHwZG8oN4py44sfwqB/zlkgS2d1pVoWxpcNR/O/hbOjNJ GcmVVJq8EwAeLmyVbn/7hPziuzEusK+dKA2pZ+XzNDhCLiFN8d3BjgWv1BMT1Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=gE8DW4zw; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.91 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=gE8DW4zw; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 752F612BA6 X-Spam-Score: -3.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: W7J6ftB9p7lv Thiago Jung Bauermann skribis: > I'm a bit concerned about running arbitrary commands as PID 1 of process > namespaces. A process running as PID 1 (even in a child namespace) is a > special case and is treated differently by the Linux kernel than any > other process, so it needs to be a program that has been designed to > work in that situation. There are two differences from regular > processes: > > 1. PID 1 inherits orphan processes and needs to wait() on them when they > quit, in order to avoid accumulating zombie processes in the system. > > 2. Unlike regular processes, PID 1 doesn't have default signal handlers. Actually right now =E2=80=98make-forkexec-constructor/container=E2=80=99 ru= ns processes as PID 1. AFAIK this hasn=E2=80=99t been a problem in practice, probably for two reas= ons: (1) we=E2=80=99re wrapping daemons that don=E2=80=99t fork (unlike Jenkins= =E2=80=A6), and (2) =E2=80=98call-with-container=E2=80=99 installs a SIGINT handler and probabl= y daemons also install SIGTERM and related handlers of their own. Anyway, it=E2=80=99s a class of problem that would be best avoided in the f= irst place! Ludo=E2=80=99.