Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1125354pxb; Thu, 4 Feb 2021 05:51:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDF6t2gUrLnYUZylE3KRcFZXi/96jsuaebQPj8uuNM9j6FChvBsvMAoxBxO70OXTjqzu/f X-Received: by 2002:aa7:c3cf:: with SMTP id l15mr7986519edr.98.1612446699943; Thu, 04 Feb 2021 05:51:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612446699; cv=none; d=google.com; s=arc-20160816; b=ZO+x6rdxzDYor8KAkWiMszEmekn8ft9B1J7S5nba4OUpWB8JWejmFEZEhqZGOQ9a5A owT39HUceSKByAF/LDJqQHjAwJNk/nVo4AzUOX8qDExNnrIhUitZXFGNTvFUbsBlXfBE A2MHhqDfOmCoZuaUHmvLnWDsVj521sV+/ljjTfeY/8bDjDGo81+umdACZ42N/5cwq17t 6g/QH51l41iqyak3UQjzzyigJzHCxtz/NdGTK/OVLasbfZ56vdsyRrwUWt3B5g+1vja/ Pj4KRpzsfBtBm+bdxq57/KqMQoPYp0HU6mOeL062e+EmE7enbStyDjCVCnvKXKKYFdVl 2zdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rrb7GIsALulMLgBpvfMJZt8+pR64np3LnHjQDkWTEbg=; b=Jhca+4sAXhtQft+GaF1X1z8A0pUJbT1prX80qUf3dsWOXg4kOFPMMA1u+IChOt+CZT xyyjhcU6sTV8DoBvrfcTB8OY20rBpy0B6L+xj982NTKK6oXwueU8xR+YQMgrbPGG9V3H DzCjK+hfNPsgQlaw+V8EEE297aKM5afU1ls7SCv8m6lWbbm7pYiuATLYDhiO25KIIOPd yOaq06CWo2Io1PqAzDrA1ux81u1yyHPKf7ENqlXOwTZnYj5fTlVf4rMR38AqWpSl0gC7 KQ1lJE7jrx5GXFG48vPgmUqBmV1w/qLJFkioKDhy0LcbLAg89Rc7+E94NM/wWdqndFNE KOBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=ZB5GwrNm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h11si3280649edb.93.2021.02.04.05.51.14; Thu, 04 Feb 2021 05:51:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=ZB5GwrNm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236461AbhBDNqr (ORCPT + 99 others); Thu, 4 Feb 2021 08:46:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236452AbhBDNqd (ORCPT ); Thu, 4 Feb 2021 08:46:33 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F6E9C061573 for ; Thu, 4 Feb 2021 05:45:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rrb7GIsALulMLgBpvfMJZt8+pR64np3LnHjQDkWTEbg=; b=ZB5GwrNmgI54ZMhy7qADcO5Cqe pc2TmFfQLSnkqU1glto/94KgR/G3d3mRniKzXkzPeoyRA5ldwMlnvn3n6LDam++0CFlr7T2ovZcnu Kjo2MGXvA5aR6SIaKa8YwUvsiFi1lNljVBGEXDam4TDBYmII7uBhtb0oY3iSNL0xs9+uNwX8gC+ro FoZXo9W31kiLLOaSXJ7Da+E3kcrVv55vPMqpluufijq5k/C6fozVECaZkgDQdHHaTZ9zObMw5snJh 3gBeifdOkJolEQGsB4XxG4EOpd/mKpIIJzkemPPfS9kdyLGhV8ZZe1KHXWkhE5vQcnI9TBHhOjL6J zjUwB3FA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1l7ex4-0007c4-Bp; Thu, 04 Feb 2021 13:45:42 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id DB36230066E; Thu, 4 Feb 2021 14:45:40 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A86D72C12E8F6; Thu, 4 Feb 2021 14:45:40 +0100 (CET) Date: Thu, 4 Feb 2021 14:45:40 +0100 From: Peter Zijlstra To: Dmitry Vyukov Cc: Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Will Deacon , LKML , Matt Morehouse Subject: Re: Process-wide watchpoints Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 04, 2021 at 02:35:36PM +0100, Dmitry Vyukov wrote: > On Thu, Feb 4, 2021 at 2:10 PM Peter Zijlstra wrote: > > > > On Thu, Feb 04, 2021 at 01:53:59PM +0100, Dmitry Vyukov wrote: > > > Humm... I was thinking of perf_event_open(pid == 0). > > > It does not make sense to send SIGTRAP in a remote process, because it > > > does not necessarily cooperate with us. > > > > > > But is there any problem with clone w/o CLONE_THREAD? Assuming the > > > current process has setup the signal handler, the child will have the > > > same handler and the same code/address space. So delivery of SIGTRAP > > > should work the same way in the child. > > > > Nothing should be doing CLONE_VM without CLONE_THREAD. Yes, it's > > possible, but if you do so, you get to keep the pieces IMO. > > > > Current libc either does a full clone (fork) or pthread_create, > > pthread_create does CLONE_THREAD. > > I meant a different thing. > I meant that we could restrict synchronous SIGTRAP for (1) > perf_event_open(pid != 0) and (2) disable it after exec. Ah, I figured a generic means to inherit across a process, but not a process tree might be useful. I don't much like magical/implied constraints. > What is the issue here for clone without CLONE_THREAD? It's an abomination that's possible and an endless cause of trouble :/