Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp270332lqt; Thu, 6 Jun 2024 03:09:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV+cazZ+zZngSFV6Cuj1Ui4PWdtWQ6nyybaa66/8uPSmNALDHgmu1+eZ2BeDo9z5C/l28C69XrGwvAhKvwt5WOOTAFnvVlNlykivHv14A== X-Google-Smtp-Source: AGHT+IFuJlTWZ3uXphYHs+a1L8nmOh8fs3mzuwcElGeJky4t1oZ6506fsdVhzGLlo9XUFkJu/iCw X-Received: by 2002:a50:99c9:0:b0:578:3335:f263 with SMTP id 4fb4d7f45d1cf-57a8b5237f0mr3384024a12.0.1717668540963; Thu, 06 Jun 2024 03:09:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717668540; cv=pass; d=google.com; s=arc-20160816; b=0tj3oN8LAOX66GsGoiQ4d4uku7XrfghtjbqQDkHzvObVFERZ9VcPcRIM13315PHNz+ /UgAC8iOKkjZJitDLNaywnk9xwEUnj9EGDdTEt8rFMyjSg3/X2oolMabwjf5qgpJGVTM UxVohrUnr/zvvNDm7J1m7sERS23IrbD9ZcLiyP4AFZ5PA71H4jZIjLWQfkzZL/kHWXtD a4S36c45UIVZezBpx7NWzwSwj0idNz6QFslhkMgwQE++5qUyzZCj4qGgY+nlkUjbEyAk WkQ6zXHThDFKyjFx8psk7X6cI1CMhqbIB4xjlT/dTJqkJrrhFEyEVEbZmo4KpMCCduYj mxQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=WqEabuleFVGI4Bpli2Csrw15euWmSuZ3oOxISs2N7T0=; fh=2YT2ZKg6O4gyvt23MXIRdTyF01Vy4oFvNtK7vHZ+usU=; b=PSEeQVpYxjuVYvTRPeAX/Cm55g7Zn+NTm6gye13ebmOHtQg4SiPfd3q6gpiFt1vu4R 06j/AHz8kXq5UmgDzzJbTJVf0gEBTG+MEi4fm2uVOC+b72jQo36boKLp9GRj78INyAHx ZSB/YyMIDwY/AtlgKXuZpoODVn612LLNQrFX8uuHkipMKWturhiumOawkUtq0KfAOdES 72VC5PTzXut6czNy0hxcewZh6ImZgWiDzoOlDsjj9khBVEt/aYSC2werdddY6kaCbWQi kuVBjFBE67S9txAZx4/jfMXi3GsPj+qhaUc13KQBEqjoHoEJ//NWcuui7S4PbA/l/RqU oCrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=G0WNRQQh; dkim=neutral (no key) header.i=@linutronix.de; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-204083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae1fc5a6si524313a12.215.2024.06.06.03.09.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 03:09:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=G0WNRQQh; dkim=neutral (no key) header.i=@linutronix.de; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-204083-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204083-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id A93311F21976 for ; Thu, 6 Jun 2024 10:09:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B6A5A18F2D0; Thu, 6 Jun 2024 10:08:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="G0WNRQQh"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="bxxuNZFW" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 99E1717D36B for ; Thu, 6 Jun 2024 10:08:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717668536; cv=none; b=sVU/aWKiSX9pw+w79YTAn2KlbEEJh5ivzcIdwr8RBiJrAJx2w1lCT/ezaN07Kxpsgmq6yxMmiQ1/kEiRdDlPDB3BUrEu6x8uCIX6tKEPDre5opDv88x72QxEp/2glnUOEe0HMlyeOCMaqpior39Pa39GqEFFMO61R5ai2dpETlg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717668536; c=relaxed/simple; bh=3M0gJX6vCn6MWF/imG0ZGKkB0QrRPP6O47dIjqNIQcQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fEFX/7PmgE3dxy/ZdxB+NhaEF055DqeQ2uiCKbUtREQMnQSMT+gL9KVuZg4Cx1wFIkQJyPhgvj1eQqsje14K0ONOmjZilIff/BRufWbcgtPGrJn08G8kjcUp/2q0sXuVuE/DIv45Vn6wUenoMyOCp15PW/5jicMTFbm3mmhf3vI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=G0WNRQQh; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=bxxuNZFW; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Thu, 6 Jun 2024 12:08:51 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1717668532; 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=WqEabuleFVGI4Bpli2Csrw15euWmSuZ3oOxISs2N7T0=; b=G0WNRQQhayj9rycvzywxCjl/Me91xNP1sFH3CwBZcxG5+InH8u5wpTp3I0RHiEsghYkw07 oSmSDHbbkms3976PrdAipSpJAbJoJ2Rmm1aqXpwfpuC2kp0NVKQlsPhQ15jWmzuJJ2s+C7 NCf7eFFbze6k5wFiomefj2BsCy5iTRxUjK76c73Q5az+zEzi99pBuUvR4EW7pcDhI8vPaD wgN7Gi4HVSokrOuGB47a634ORm+eaAOpLAVbcssltLpGXRrsirkDe+fw2HzcuOB+AtIdwN BFOylvfN+0z1Ixs52pseXpqCivCmDPVHx2XAjaWPga8KoKedqGDm1C3KXnlWWw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1717668532; 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=WqEabuleFVGI4Bpli2Csrw15euWmSuZ3oOxISs2N7T0=; b=bxxuNZFWHbVeBoCwQ5D/Aq46K+fjoWNIwm06NSugsw3x788mDZ8B29+0c9uFc6dwBaMm8n AduY/yzp8wAfIAAA== From: Sebastian Andrzej Siewior To: Frederic Weisbecker Cc: LKML , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter Subject: Re: [PATCH 3/4] perf: Fix event leak upon exit Message-ID: <20240606100851.QI7uQRSB@linutronix.de> References: <20240516140936.13694-1-frederic@kernel.org> <20240516140936.13694-4-frederic@kernel.org> 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=utf-8 Content-Disposition: inline In-Reply-To: <20240516140936.13694-4-frederic@kernel.org> On 2024-05-16 16:09:35 [+0200], Frederic Weisbecker wrote: > When a task is scheduled out, pending sigtrap deliveries are deferred > to the target task upon resume to userspace via task_work. > > However failures while adding en event's callback to the task_work an > engine are ignored. And since the last call for events exit happen > after task work is eventually closed, there is a small window during > which pending sigtrap can be queued though ignored, leaking the event > refcount addition such as in the following scenario: Sebastian