Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1582628pxa; Thu, 6 Aug 2020 10:48:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzC4JXBJMuBd6aqaASos4DiP/6j60VcHSJM5q9c7GxgqZXWfSookoF/NobTlk8Zwwbj37U X-Received: by 2002:a17:906:6d91:: with SMTP id h17mr5204539ejt.531.1596736129971; Thu, 06 Aug 2020 10:48:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596736129; cv=none; d=google.com; s=arc-20160816; b=PBZs0U01QYyIbK9gKYVUU/zGBZkYp3nBYNRfSn7BJqTkDvpV+Afd0ozDXUNyN5Twbu vH+9LwuEqHlN7QGsGPn8S1q61ESG/h5q2oAXlPOawhoC+WRA1E3aYxVJ4Lrs9V8e0+yC V27PtqP/9W2umbF6I98XOdJbXo6rjpc6tjiwCcr+QyyCCtsaVdZ9cyqg7F26mcSRlQej RvWyWQUZC9clG3JLCm0QmskE3wCqUnjIFD+llGCDMj2bapEHFHSIF6EL3CXJF1knNeGf s5/i734l4VmJD+KCRwukZqTAf6czvyy4A5mtkNTqDF4B0zehlBRyFnTdQQWyMlHRmNLT yQUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=eHoOBZZp9uYxW+ZnPruQMGY41kBQsEXcFDuJUliDZzc=; b=hhEVrEq1u1jw7P2Vq+RrDU8BnFWOgrzLPScYqy63oiQ3N9L6zK2mJ7ySowfr7zkh7v WlcwvG1UwnqwigUfsUH0vvhlNomNQl7zMixUbO2GISL2jqAJAf2DRY7nUPwb3cUNRH5v Xzgzz2PznKuwVKjPy4mr0NF5Go1e3kcNyDHM0s272np6aTrEjDpvFvFyDUjQmqace5FU vXdgsIW61rJLuHpD/6hJLUf6DtkiY/368S/L8YkObAEe1u2IOrHYmdWM8vssx8mDwvjU YBvNEuvWb5e60QNd/1Bwy6koVx91TatjAt72eYT1U8WFrQW2sGfPoejdW33apvuqW7sg j4EA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qw24si3902401ejb.416.2020.08.06.10.48.27; Thu, 06 Aug 2020 10:48:49 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729360AbgHFRpy (ORCPT + 99 others); Thu, 6 Aug 2020 13:45:54 -0400 Received: from mga02.intel.com ([134.134.136.20]:11127 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728234AbgHFQih (ORCPT ); Thu, 6 Aug 2020 12:38:37 -0400 IronPort-SDR: fE0GVkJOzDvZFi9c+cQSHzm6Kwn6tKCMAJDuCnq+64C7u5C2+4HbO5755dcdHPGMkRynQeee/m D3yab4csLR7w== X-IronPort-AV: E=McAfee;i="6000,8403,9704"; a="140707733" X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="140707733" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Aug 2020 08:32:06 -0700 IronPort-SDR: 9dqFfthCWP0LCXusvT7/YdIN2LUfL+dM8a7cOSPw//37suISlg4AYceONUhkp3L97Q2vJ28zie pSeFYhboG0hA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,441,1589266800"; d="scan'208";a="276413105" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.21]) by fmsmga008.fm.intel.com with ESMTP; 06 Aug 2020 08:32:05 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 76CC6301CAC; Thu, 6 Aug 2020 08:32:05 -0700 (PDT) Date: Thu, 6 Aug 2020 08:32:05 -0700 From: Andi Kleen To: peterz@infradead.org Cc: Alexander Shishkin , Arnaldo Carvalho de Melo , Ingo Molnar , linux-kernel@vger.kernel.org, Jiri Olsa , alexey.budankov@linux.intel.com, adrian.hunter@intel.com Subject: Re: [PATCH 1/2] perf: Add closing sibling events' file descriptors Message-ID: <20200806153205.GA1448395@tassilo.jf.intel.com> References: <20200708151635.81239-1-alexander.shishkin@linux.intel.com> <20200708151635.81239-2-alexander.shishkin@linux.intel.com> <20200806083530.GV2674@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200806083530.GV2674@hirez.programming.kicks-ass.net> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > This adds an opt-in flag to the perf_event_open() syscall to retain > > sibling events after their file descriptors are closed. In this case, the > > actual events will be closed with the group leader. > > So having the 1:1 relation with filedesc imposes a resource limit on > userspace. > > This patch breaks that and enables a user to basically DoS the system by > creating unbound events. The idea was to account the events in the locked memory allocation too. Not sure that made it into the patch though. It has a minor issue that it might break some existing setups that rely on the mmap fitting exactly into the mmap allocation, but that could be solved by allowing a little slack, since the existing setups likely don't have that many events. There's also a secondary issue of DoS the kernel by creating very long lists to iterate, but I suppose this is already quite possible, so probably not a new issue. -Andi