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 4EDA1EEBB for ; Sun, 2 Nov 2025 16:22:11 +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=1762100534; cv=none; b=TZJ+vhATwUTM361YhwTdrB7Y4hUouoIgX3BWyABroN+7IvVOw1CxDk/OSJDlgr3dU/Brwfo/tsvJx35UPcQ00r3aOR+Ai98gtrYlt46zVx7OHwN8HyQEKbx8VRDps/IYuHIBBXNtGB2oCoQ17EcY7YnNZvZUA64z4YBFEr2mS1Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762100534; c=relaxed/simple; bh=iG2KQ8qLy8NEMm7RGCihOKaL+oJ1qpZrxyH3HsoBnsE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=L/3VmPDnDRClCCVCmozo5Ii+CNOuLXtW8vMVO+mJyP7W+p9KB6JjFBw/G4sge6JqGS3Ws8HgzRO2//jZhFzgBeHVCoEeOfH4fREZ33LZS8BN84KH/DPbZIJEnu2OaxwcbMY2pEmTBMbaknXsaH6sW67Co/41+wJ9W17PX54evgM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=PMpn8abd; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="PMpn8abd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1762100531; 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=zbrG4ZmxeWTi8gs7vSwXBAYrF+YpwtGZmkJmucMkWII=; b=PMpn8abd5Ci44uc6V32Dvt7m5qhk9ON3P1pLh0mVs+rX2Z2FuIUL0fFmQMHb/Zs6wvFEn8 6lxO4euehM4m3Uxtx0cso6uG0aca+wZc0kwZx2nmBnD1Z54Y0JNsSXVKYMH1iC/89UWS64 /LxlnnjRRZ6XTrfNLnVG77DZI8jUXF4= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-146-jWQHTZ-9OWOK6wI4YNnlSw-1; Sun, 02 Nov 2025 11:21:57 -0500 X-MC-Unique: jWQHTZ-9OWOK6wI4YNnlSw-1 X-Mimecast-MFC-AGG-ID: jWQHTZ-9OWOK6wI4YNnlSw_1762100336 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BB13719560B3; Sun, 2 Nov 2025 16:18:52 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.45.224.84]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with SMTP id 7E3DF1800579; Sun, 2 Nov 2025 16:18:30 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Sun, 2 Nov 2025 17:17:35 +0100 (CET) Date: Sun, 2 Nov 2025 17:17:12 +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, linux-security-module@vger.kernel.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 , Elena Reshetova , David Windsor , Mateusz Guzik , Ard Biesheuvel , "Joel Fernandes (Google)" , "Matthew Wilcox (Oracle)" , Hans Liljestrand , Penglei Jiang , Lorenzo Stoakes , Adrian Ratiu , Ingo Molnar , "Peter Zijlstra (Intel)" , Cyrill Gorcunov , Eric Dumazet Subject: Re: [PATCH v17] exec: Fix dead-lock in de_thread with ptrace_attach Message-ID: <20251102161712.GA4273@redhat.com> References: 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.30.177.93 On 08/21, Bernd Edlinger wrote: > > v16: rebased to 6.17-rc2, fixed some minor merge conflicts. > > v17: avoid use of task->in_execve in ptrace_attach. So I guess this version doesn't really differ from v14 I tried to review... (yes, iirc my review wasn't really good, sorry). Perhaps I am wrong, but I still think we need another approach. de_thread() should not wait until all sub-threads are reaped, it should drop cred_guard_mutex earlier. I mean, something like [PATCH V2 1/2] exec: don't wait for zombie threads with cred_guard_mutex held https://lore.kernel.org/lkml/20170213180454.GA2858@redhat.com/ which is hopelessly outdated now. Again, perhaps I am wrong. I'll try to take another look next week. Oleg.