Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1240085imu; Wed, 28 Nov 2018 06:45:06 -0800 (PST) X-Google-Smtp-Source: AJdET5e+68n+m4BvCNCzfrQfIRhIw+y/gXJMwAYsY6VLwbZcgf/CRxsKrEopQdgvLJKiwwxiHZ3S X-Received: by 2002:a62:15c3:: with SMTP id 186mr38894222pfv.240.1543416306217; Wed, 28 Nov 2018 06:45:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543416306; cv=none; d=google.com; s=arc-20160816; b=PPPldlBfZ9kIgDcP4FPX4QeklItRCJCXdNSb6Uy36vmUnlo8iiMExuwp/VhVOdDBwi 1pUmkGquDZHh0MnqbBkdTA5ZW8fbwOMVRbw95L+NSu2xytPKa5Qn7oo0wxwavGhYoAaJ SpQqKqUFzPZVeT421CrlSXZKryOaXdS9T8SEeL8EGek0u0yKe/zy/CNk2MZ6VGdHvucf v5Uo4qMcfz1ufjCvwkLSznlSK4QUTtbNbYGYLMFzMwLjGyP1Q8u25r5yRwT5dvkbTUrZ Y2P/hQJZGk2pqoP26Saxijvy2jTd4e4Wg3njXDKMmGD2fdIF5VkZg56FcS1uSKC3F+Pi KV2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=+88sFKqaeEilL2oqqCexP0LHy92sjB200gG76kail8k=; b=Q37MPbVoRUZl2qgc/KM7yuXMGrOUVTCSF6i8m24Wm6sTM92DpgfBBO/VJ8lq3RQslB 6sBgT4QijEpORMX1UdNfRTcel2AO3pJs5cUdeWWWi85k42bz9IQNIxLaww+D/47mjCaT lQfbRsa7o+sI77m310vOa4FegNyGeiOVHLoIzTlY2eR3gL17mHXS78eQV1qrtdxBRsCL M0YrZH4BC1iXdwFF2WCKwnGjIuoyWlBBAgJ05e4IGPy2llQpuJXHftJMgGLbrjF3ZxWM TLWOGf24LXScu7Rr464laRLR7h4ZFkal0zd0JmH8Jy+l+I7URmmp4uscnIOjcf+pz/nx ysLQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k14si7365940pll.346.2018.11.28.06.44.49; Wed, 28 Nov 2018 06:45:06 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728747AbeK2Bo1 (ORCPT + 99 others); Wed, 28 Nov 2018 20:44:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56374 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727789AbeK2Bo1 (ORCPT ); Wed, 28 Nov 2018 20:44:27 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 27F233002E12; Wed, 28 Nov 2018 14:42:34 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.12]) by smtp.corp.redhat.com (Postfix) with SMTP id 5A6C4105705A; Wed, 28 Nov 2018 14:42:31 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Wed, 28 Nov 2018 15:42:33 +0100 (CET) Date: Wed, 28 Nov 2018 15:42:31 +0100 From: Oleg Nesterov To: =?iso-8859-1?Q?J=FCrg?= Billeter Cc: Andrew Morton , Thomas Gleixner , Eric Biederman , Kees Cook , Andy Lutomirski , linux-api@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] prctl: add PR_{GET,SET}_KILL_DESCENDANTS_ON_EXIT Message-ID: <20181128144230.GG30395@redhat.com> References: <20181127225408.7553-1-j@bitron.ch> <20181127225408.7553-2-j@bitron.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181127225408.7553-2-j@bitron.ch> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 28 Nov 2018 14:42:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/27, J?rg Billeter wrote: > > @@ -704,6 +713,9 @@ static void exit_notify(struct task_struct *tsk, int group_dead) > struct task_struct *p, *n; > LIST_HEAD(dead); > > + if (group_dead && tsk->signal->kill_descendants_on_exit) > + walk_process_tree(tsk, kill_descendant_visitor, NULL); Well, this is not exactly right, at least this is suboptimal in that other sub-threads can too call walk_process_tree(kill_descendant_visitor) later for no reason.