From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754916AbdDEQQG (ORCPT ); Wed, 5 Apr 2017 12:16:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43986 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752923AbdDEQPn (ORCPT ); Wed, 5 Apr 2017 12:15:43 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3A63E2EF183 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=oleg@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3A63E2EF183 Date: Wed, 5 Apr 2017 18:15:28 +0200 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Andrew Morton , Aleksa Sarai , Andy Lutomirski , Attila Fazekas , Jann Horn , Kees Cook , Michal Hocko , Ulrich Obergfell , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [RFC][PATCH v2 4/5] exec: If possible don't wait for ptraced threads to be reaped Message-ID: <20170405161528.GC14536@redhat.com> References: <20170303173326.GA17899@redhat.com> <87tw7axlr0.fsf@xmission.com> <87d1dyw5iw.fsf@xmission.com> <87tw7aunuh.fsf@xmission.com> <87lgsmunmj.fsf_-_@xmission.com> <20170304170312.GB13131@redhat.com> <8760ir192p.fsf@xmission.com> <878tnkpv8h.fsf_-_@xmission.com> <874ly6a0h1.fsf_-_@xmission.com> <87efxa8lq7.fsf_-_@xmission.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87efxa8lq7.fsf_-_@xmission.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Wed, 05 Apr 2017 16:15:42 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/02, Eric W. Biederman wrote: > > Take advantage of the situation when sighand->count == 1 to only wait > for threads to reach EXIT_ZOMBIE instead of EXIT_DEAD in de_thread. Let me comment this patch first, it looks mostly fine to me. And note that this is what my patch does too: exec() waits until all threads pass exit_notify() and drops cred_guard_mutex. However, with my patch patch exec() then waits until all threads disappear. This is uglifies the code but this is simple and safe. With your patches exec doesn't do another wait and succeeds after the 1st wait. I think this is wrong and the next patch is not enough. Oleg.