Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2220198ybf; Mon, 2 Mar 2020 04:30:04 -0800 (PST) X-Google-Smtp-Source: APXvYqx2DdXI0Ui4rNf+oF4O55pVjFMNgljE1tjgkyWLR16986gxuH/6UvoCdsqxF3waQ92N40kU X-Received: by 2002:a05:6830:c7:: with SMTP id x7mr12440359oto.272.1583152204735; Mon, 02 Mar 2020 04:30:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583152204; cv=none; d=google.com; s=arc-20160816; b=Yv3YNgGzXqE3yCTCZGvfRkVZGfNJzJjWGa8amOejZoyY4FueROCK1Z0On6anm6QVbw FCFhvmnfFr+u5AyxGMKAUKNqAEGSFhsfBqeFRekCtuIbORnhKCgsNPJT8kB0Y3dF+/hG U7HhRGU2T3qUf0uvpfRS9m1G/G+GDH0l4SThNLvyJfqZtsfEnIz6i9NJLTwKJQuoXdbA fpeAdLMNC/ZslKsptVkkBZ/GP1KysSa8NRw1GZk/95m8Qyb8/+wsx5Jvd8mVtLwaf256 y7u8MJE2O1EhzS9duioXyieyCgpilHDi1AClHgbXAatCoHyezdv0XQM2KTBCCMri/Aqq UVow== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5DG/vW6TCeCX771cIMr5N8VanNi7DmSktqX7A9P5Lf4=; b=sMC2pRHmQh2/MzxmR9OZnXvCABVlaUD+L4y4xnnkltaGdbY/atpri50Um4o/I4N0q3 sH7w0J3dvfzDzn7Q0Nw2nln7tjbFiCISe6YhH0Slk4Y1LZcFdVvln07qwLRLhlVoWaBq x58UtM/kvs7HhByR2o5XDhV3bCOqh+OG7IKcsWP+KXkZhdrFu9S4DjCYWAbuCFE+ufBa 4jmWQjxoroi6mX/m0ui051nFisFUuw8jnDmRDYq0iycnSz4GD8qkS2bKwU0pghJleiQK wLDsDRPKYWNmuFfpwxFIP70WoA9XgUyx+/n+nRXVKTzgyOAaRF2MZXWBL3xIWgY/cQDd KPPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VsJemNTs; 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=pass (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 k20si5498778oiw.273.2020.03.02.04.29.52; Mon, 02 Mar 2020 04:30:04 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VsJemNTs; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727864AbgCBM2q (ORCPT + 99 others); Mon, 2 Mar 2020 07:28:46 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57895 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727691AbgCBM2p (ORCPT ); Mon, 2 Mar 2020 07:28:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583152124; 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=5DG/vW6TCeCX771cIMr5N8VanNi7DmSktqX7A9P5Lf4=; b=VsJemNTsTuZC8xC8GcYvGTsNDuny4AfTVE+m+JgYgUCFwjOMh2BZbr0HoOo/epysYKo11R 4cCktcYhLAMpTZKJp87jzhO6aWFvM/Tapx5mutTE9jo8CwgILyAEF3LGzhGf6dSBbV8Ljp iDxBD9K3wKFKQbDkBfGpmwwRAW0jcr8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-359-GBOwynXFNxyRVY2vU-jPUQ-1; Mon, 02 Mar 2020 07:28:40 -0500 X-MC-Unique: GBOwynXFNxyRVY2vU-jPUQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 622221B2C988; Mon, 2 Mar 2020 12:28:36 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.43.17.70]) by smtp.corp.redhat.com (Postfix) with SMTP id DA8D99051B; Mon, 2 Mar 2020 12:28:29 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Mon, 2 Mar 2020 13:28:36 +0100 (CET) Date: Mon, 2 Mar 2020 13:28:29 +0100 From: Oleg Nesterov To: Bernd Edlinger Cc: Jann Horn , Christian Brauner , Jonathan Corbet , Alexander Viro , Andrew Morton , Alexey Dobriyan , "Eric W. Biederman" , Thomas Gleixner , Frederic Weisbecker , Andrei Vagin , Ingo Molnar , "Peter Zijlstra (Intel)" , Yuyang Du , David Hildenbrand , Sebastian Andrzej Siewior , Anshuman Khandual , David Howells , James Morris , Kees Cook , Greg Kroah-Hartman , Shakeel Butt , Jason Gunthorpe , Christian Kellner , Andrea Arcangeli , Aleksa Sarai , "Dmitry V. Levin" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , "stable@vger.kernel.org" Subject: Re: [PATCHv2] exec: Fix a deadlock in ptrace Message-ID: <20200302122828.GA9769@redhat.com> References: <20200301185244.zkofjus6xtgkx4s3@wittgenstein> 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 2.79 on 10.5.11.13 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/01, Bernd Edlinger wrote: > > This fixes a deadlock in the tracer when tracing a multi-threaded > application that calls execve while more than one thread are running. Heh. Yes, known problem. See my attempt to fix it: https://lore.kernel.org/lkml/20170213141452.GA30203@redhat.com/ > @@ -1224,7 +1224,7 @@ struct mm_struct *mm_access(struct task_struct *task, unsigned int mode) > struct mm_struct *mm; > int err; > > - err = mutex_lock_killable(&task->signal->cred_guard_mutex); > + err = mutex_lock_killable(&task->signal->cred_change_mutex); So if I understand correctly your patch doesn't fix other problems with debugger waiting for cred_guard_mutex. I too do not think this can justify the new mutex in signal_struct... Oleg.