Received: by 2002:a05:7412:7c14:b0:fa:6e18:a558 with SMTP id ii20csp330881rdb; Mon, 22 Jan 2024 05:46:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0UfPmU+6FIQUMrkyGVXxRuTq4fOM7tX0fLXbaMmyEL2q7lW0DW47Y8km4+dxNlhamqWuX X-Received: by 2002:a05:6a20:3d03:b0:199:e6af:30a with SMTP id y3-20020a056a203d0300b00199e6af030amr7347979pzi.38.1705931195740; Mon, 22 Jan 2024 05:46:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705931195; cv=pass; d=google.com; s=arc-20160816; b=V+WS2odYydn1pI2r1BqB3MHDIYSTejC2MDSbsbpre1zEzE/k6Pex9lyQ1IYIBjb8Ia z1M70NYe5oEPvOBj1Fql8UuVYq6AaIsH5s1JBTZR+j55KWyDlXLpNO+rNZr1JOoKK0dM CGaV6e06aQlWYY3hMRZf5C1rCe8tw+pQ5JhCq5LOqVzXvD62neXwuFoJZZrEvMECHp96 FtFSJ/N037/+ZiceFHXaWbmf8wAnUw7c4QPO2MuYlM75RIcT6JP+9pfeqC7LrItQtkx4 kQVsPbPRKDcv0zxf6cbYsRPfnK1mccktnUSMn/Y2YKNVCijlfIQql4eK+GM5bDURRugh YBxQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=TA5S6rkWrfMIGQh8b4nq6v9XJGxLaFmJwtdW6D84hqc=; fh=WbiPWVJdPw8Cr4myMGvuemWCU0jnwfwiSx8atqjaKmE=; b=NFlKXq+IsNpZk0CMWPTOeBRkPtXs/8PjudC3CLWlz300SK1dgrfx2AE5FpBlh7ny+8 A+NRAwTEVPhCnItyRYCvIbklt/EjE0JetvxPYuEleoghE4TL1XyPRxa/du75LDlvf2Ms Jpm0mCKbnb1uOie5lSYD6TstPnyoGq3WAAYt1dfoI5ttzxN7bJILFzHNe+ZdWMxB5Tcl OCo3UStn53pWszHgGpECJsMgjjqwBhwi8Q3tYy+g7BOZ7hfK7KSfJS1QN8/Wa4Kpp9QY 5d0fUY9KzSOUZwSA2JHX7Nbd03HUmcOt3lQmtqSHM6ac698w0clOySOrOj80xjZQ+sx8 ENzQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hcwEfNfs; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-33108-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33108-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9-20020a633609000000b005cf2fd55ee2si8097188pga.324.2024.01.22.05.46.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 05:46:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-33108-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hcwEfNfs; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-33108-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-33108-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 53F5F2860A6 for ; Mon, 22 Jan 2024 13:46:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 187C43D0D0; Mon, 22 Jan 2024 13:46:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hcwEfNfs" 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 00AEA3D0B9 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=ruHqQXqZmlUEZ6xk16v+uiLJ+dGACCiGCLWKDPxgFY9bYEmwPVG7IxYY7KFL+ewo3stqxQkgRiI3tzpz6MFAlCtWvyfSP3b854YpFS/NSorbq09gh8DXdXiVT/B7tE07RYq5iaPpp6xblV/9tIHs8NyPtJZhXZCCy2HPczULCMk= 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=hcwEfNfs; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705931177; 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=hcwEfNfsP1NuoTL5AzGeVz0eSmDoaAFJsC0fvLMuj0oc1F2jrBPnkCkSK0tCGlyeMrpLVq hkpFPUIvTkAJQgepfhETrp/iyUFgiltuQwWKn42a2lLP7jxDzw+kblbKoSfvlDyPz4BlJh 7sQvelG4PtAF96iAy52c7/DTuRQRmp4= 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-kernel@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.