From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC23F3D0B3 for ; Mon, 22 Jan 2024 13:46:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705931180; cv=none; b=a/i/WkNS42ZLYeHWE0HJj2lymyaqD0D2A3FYqNdoawr/t/6BmpXbAoxE54hSUY83zAfbOHhd7/V8KGO6KhNDIf7OX5QP2ejlCfDY5eDSQ2ErsuzEUkTbVfLc1FtqvvOAu3qbYkqfskt2oB0xRsnEJzoA7o0/tjsEcF5dzfFBxb4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705931180; c=relaxed/simple; bh=TA5S6rkWrfMIGQh8b4nq6v9XJGxLaFmJwtdW6D84hqc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QrtRY5VADb5JcSe4lCik71Uj9w1V2LyIOPKZDs5HEa+TkXb5Ak5i4+VNVV14jmuTYtjO/fTnmxZ5q67OOT15oZyVYf+E4zx0Juwlyz0Z6RsuHymv4FRjB+4tLrZPY30nQqp1HxPIP5guCLnxvhLTzeJdoPTtCiq5wmlDh0PoC6A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=F9e0yXBE; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="F9e0yXBE" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705931178; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=TA5S6rkWrfMIGQh8b4nq6v9XJGxLaFmJwtdW6D84hqc=; b=F9e0yXBERwR3qcdv8kd0RCj3g7YWx+wIWnbEhJKdzvhsy8yI4Gcz+/Vuk3S1fh+iQPfxoo ndDXXdDBlUMWukIsAwFbVSaxkF+VEnVwUpBPf4qPMeWRxuF0vLKTOPSCmticUVLLbNjLUw 5+oP1JUYY8Eh2DjJYSskiB7u5LW+7ZQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-rOsLYw9bNWC8ERd5q2uA1Q-1; Mon, 22 Jan 2024 08:46:14 -0500 X-MC-Unique: rOsLYw9bNWC8ERd5q2uA1Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 27D14862CC5; Mon, 22 Jan 2024 13:46:12 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.225.26]) by smtp.corp.redhat.com (Postfix) with SMTP id 14FC1C30BE1; Mon, 22 Jan 2024 13:46:00 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 22 Jan 2024 14:44:58 +0100 (CET) Date: Mon, 22 Jan 2024 14:44:46 +0100 From: Oleg Nesterov To: Bernd Edlinger Cc: Alexander Viro , Alexey Dobriyan , Kees Cook , Andy Lutomirski , Will Drewry , Christian Brauner , Andrew Morton , Michal Hocko , Serge Hallyn , James Morris , Randy Dunlap , Suren Baghdasaryan , Yafang Shao , Helge Deller , "Eric W. Biederman" , Adrian Reber , Thomas Gleixner , Jens Axboe , Alexei Starovoitov , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , linux-kselftest@vger.kernel.org, linux-mm@kvack.org, tiozhang , Luis Chamberlain , "Paulo Alcantara (SUSE)" , Sergey Senozhatsky , Frederic Weisbecker , YueHaibing , Paul Moore , Aleksa Sarai , Stefan Roesch , Chao Yu , xu xin , Jeff Layton , Jan Kara , David Hildenbrand , Dave Chinner , Shuah Khan , Zheng Yejian , Elena Reshetova , David Windsor , Mateusz Guzik , Ard Biesheuvel , "Joel Fernandes (Google)" , "Matthew Wilcox (Oracle)" , Hans Liljestrand Subject: Re: [PATCH v14] exec: Fix dead-lock in de_thread with ptrace_attach Message-ID: <20240122134446.GB22901@redhat.com> References: <20240116152210.GA12342@redhat.com> <20240117163739.GA32526@redhat.com> Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 I'll try to read your email later, just one note for now... On 01/22, Bernd Edlinger wrote: > > > I didn't say that t is a group leader. I said it can be a zombie sub-thread > > with ->exit_state != 0. > > the condition here is > > (t != tsk->group_leader || !t->exit_state) > > so in other words, if t is a sub-thread, i.e. t != tsk->group_leader > then the t->exit_state does not count, Ah indeed, somehow I misread this check as if you skip the sub-threads with ->exit_state != 0. Sorry for noise. Oleg.