Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4334073imm; Mon, 30 Jul 2018 12:40:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfeitUqQau9yXagGdqobKrUv8mTQ0mr66nwbWxkzZEq47Tb4fqtYupr3SJQYUWuGCpx+sPe X-Received: by 2002:a17:902:5281:: with SMTP id a1-v6mr17468494pli.73.1532979648691; Mon, 30 Jul 2018 12:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532979648; cv=none; d=google.com; s=arc-20160816; b=JeGTx6d85SP1Rg5Sa7R9gfOx7PpS0dPe+QvPWRwdtpWFj11DgbeqdOkdxcxXr7IyiT 1+BZ3ZLoNIT++XlBzuB7XyG0prkPBIJS0OQneVlNjT0W5X9UcnCz3+ml2/f0J+wq+eqD cVNXons6eElfBpB9oSDgA2v+4rgmPFK9Yt47+hwipIAZFguAKWve+rQCyyuhut6D/PUp jbQPZYj4NKE4L9L8xf7RLMiCQfqOHUlWy0ss+S/Zyi752ETFMAgjMhTcd4OL4+uhWZVp 4tyio1f3zSKMiQtYPxAP7XpwgnZ2iUQ1AKCm+GgNbNGWOd1QGNNyWxjhEcV3+nAjoqCA eRfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=z54qwkhFIZDOEUakQhKQI3UWEiiMOtJEL6jxepe+Xd4=; b=tMfdOs6YVrGXe4/RsBnC2gl7gvUAyj1PCUkmpvy+EsdXlDDvFHbhIgUJAOMc10cT3x nIr3FiKJZXQHT7PmcymZgcWeG3yvRn51xsg9TP3xzxg7rn64sibauN7j6kgY+p3dSCty NotB/YxIIFTldiGAc6B+hqBsYaupGl3Inoxexk3HlHmOwTzqMTKLRevJaWdAIMGvVbC2 loQgWAVjZa9uL6wV04BCftez0r5P+lkJ5/MiKIlGMLfYbArEjQ4rsIgjL51lG8dfNR9F lnLWKtApve+mwLMzYsi95x5azhytvh9nFACkmNbBdOB0kINAEqpZWu9kOUhecogY7EEN 6wuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18-v6si12022339pfi.88.2018.07.30.12.40.34; Mon, 30 Jul 2018 12:40:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732024AbeG3VQK (ORCPT + 99 others); Mon, 30 Jul 2018 17:16:10 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:57318 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731927AbeG3VQJ (ORCPT ); Mon, 30 Jul 2018 17:16:09 -0400 Received: from p4fea5a5a.dip0.t-ipconnect.de ([79.234.90.90] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fkE0z-0005wg-6K; Mon, 30 Jul 2018 21:39:33 +0200 Date: Mon, 30 Jul 2018 21:39:32 +0200 (CEST) From: Thomas Gleixner To: =?ISO-8859-15?Q?J=FCrg_Billeter?= cc: Oleg Nesterov , Andrew Morton , Eric Biederman , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] prctl: add PR_[GS]ET_KILLABLE In-Reply-To: <922baeb3d6d6387c480026fc3a6ca01d915f60a5.camel@bitron.ch> Message-ID: References: <20180730075241.24002-1-j@bitron.ch> <20180730101659.GA24781@redhat.com> <922baeb3d6d6387c480026fc3a6ca01d915f60a5.camel@bitron.ch> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-788013628-1532979573=:1725" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-788013628-1532979573=:1725 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Mon, 30 Jul 2018, Jürg Billeter wrote: > On Mon, 2018-07-30 at 12:17 +0200, Oleg Nesterov wrote: > > On 07/30, Jürg Billeter wrote: > > > > > > This is required for job control in a shell that uses CLONE_NEWPID for > > > child processes. > > > > Could you explain in more details? > > The SIGNAL_UNKILLABLE flag, which is implicitly set for tasks cloned > with CLONE_NEWPID, has the effect of ignoring all signals (from > userspace) if the corresponding handler is set to SIG_DFL. The only > exceptions are SIGKILL and SIGSTOP and they are only accepted if raised > from an ancestor namespace. > > SIGINT, SIGQUIT and SIGTSTP are used in job control for ^C, ^\, ^Z. > While a task with the SIGNAL_UNKILLABLE flag could install handlers for > these signals, this is not sufficient to implement a shell that uses > CLONE_NEWPID for child processes: > > * As SIGSTOP is ignored when raised from the SIGNAL_UNKILLABLE process > itself, I don't think it's possible to implement the stop action in > a custom SIGTSTP handler. > * Many applications do not install handlers for these signals and > thus, job control won't work properly with unmodified applications. > > Job control in a shell is just an example. There are other scenarios, > of course, where applications rely on the default actions as described > in signal(7), and PID isolation may be useful. In my opinion, the > kernel support for preventing accidental killing of the "init" process > should really be optional and this new prctl provides this without > breaking backward compatibility. This makes sense and exactly that information needs to be in the changelog. Thanks, tglx --8323329-788013628-1532979573=:1725--