From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751432AbdJEQ1i (ORCPT ); Thu, 5 Oct 2017 12:27:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43124 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751144AbdJEQ1h (ORCPT ); Thu, 5 Oct 2017 12:27:37 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EAC427EAA1 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=oleg@redhat.com Date: Thu, 5 Oct 2017 18:27:33 +0200 From: Oleg Nesterov To: =?iso-8859-1?Q?J=FCrg?= Billeter Cc: "Eric W. Biederman" , Andrew Morton , Linus Torvalds , Michael Kerrisk , Filipe Brandenburger , David Wilcox , hansecke@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [RESEND PATCH] prctl: add PR_[GS]ET_PDEATHSIG_PROC Message-ID: <20171005162733.GA20068@redhat.com> References: <20170909094008.49983-1-j@bitron.ch> <20170929123058.48924-1-j@bitron.ch> <20171002162041.a7cefe8af71327b8becd2347@linux-foundation.org> <87o9pogbf7.fsf@xmission.com> <1507013157.2304.48.camel@bitron.ch> <878tgse1c5.fsf@xmission.com> <1507050019.19102.51.camel@bitron.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1507050019.19102.51.camel@bitron.ch> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 05 Oct 2017 16:27:37 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/03, Jürg Billeter wrote: > > My use case is to provide a way for a process to spawn a child and > ensure that no descendants survive when that child dies. Avoiding > runaway processes is desirable in many situations. My motivation is > very lightweight (nested) sandboxing (every process is potentially > sandboxed). > > I.e., pid namespaces would be a pretty good fit (assuming they are > sufficiently lightweight) but CLONE_NEWPID sorry if this was already discussed, I didn't read this thread yet... if CLONE_NEWPID is not suitable for any reason. We already have PR_SET_CHILD_SUBREAPER. Perhaps we can simply add another PR_SET_KILL_ALL_DESCEDANTS_ON_EXIT? we can use walk_process_tree() to send SIGKILL. Oleg.