Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1652177ybc; Wed, 13 Nov 2019 02:09:50 -0800 (PST) X-Google-Smtp-Source: APXvYqx6MO2y6WISizya5v4eMJKklLSMkfV2UNJFG8VwEquWRy5gKMCSvmQblfoDEESTN45Fv3Dd X-Received: by 2002:a50:fc18:: with SMTP id i24mr2560733edr.41.1573639790773; Wed, 13 Nov 2019 02:09:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573639790; cv=none; d=google.com; s=arc-20160816; b=Drdhlz/zQCQ8HVnRmMJy3c76YyUyvD5cyKpzEJlrbYBmgLGJfYcWV3ZCWXounZMs63 CpXETNZNgM3p4VMthb100tIMdH+25mAoMiCQB/f0orJZq9yDi+rLTDB1HP4aj+P4wvg3 iZAFxlHpoyEApUKazXwhWIPe52md2KvMYVpGEzh7L8vtboIhjkUlEUlVdNvtk6AWqVcu 5k+/dqqZR+iKICnoiKq+2Os+H9ZrWf4GUvHxt/fhcC3AJ4BGOrAXqASyqxxuoUvy14qN VVLxN8auWhmLJfNEflXj4aZ6fQFNRNAO1tjwLGIJkekPcu0o4z9pOzS04e5E7LwJqyYe KYOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=QiIL03RJ8lN5p3VmEGwwpG9OuU9Y0Y2QTE/IRnLy0x4=; b=BOxTJd0wz0de1kRj96fcwawjUlwjo0hDSlQZXC3vp0xYEZh9PEeLywWOGGAyS6HbQz bK1yVk82Dlfb4XTaK7xbJQzBBIJ4NmWdUsbrOKMzO+hgV0olm3NPsTnC63GrRT6zxaPQ N+CCTDQcE8H6YjAQ0WedU0RMxKJhvgSTUgyokfHN+I2CbvV+9Hh9JvTKG4jcxXCu/MLf CszVmwFKZK/lPjDCa2Ra5JpfeHmsaARONSAABWyJWVOglD9v1IYjD1FVL3Qw3ayXOM6p YdSfgtB3HgAyZBZHB8uwtTWi8ZNWhvS5NLCSs+sKoDTUVmwl1YmZRGAJYx9tDscR9RHj 3d9A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rk9si843886ejb.301.2019.11.13.02.09.26; Wed, 13 Nov 2019 02:09:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727540AbfKMKGv (ORCPT + 99 others); Wed, 13 Nov 2019 05:06:51 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:37170 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727344AbfKMKGn (ORCPT ); Wed, 13 Nov 2019 05:06:43 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iUpXf-0000HG-3G; Wed, 13 Nov 2019 11:06:27 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id B89A81C03A8; Wed, 13 Nov 2019 11:06:26 +0100 (CET) Date: Wed, 13 Nov 2019 10:06:26 -0000 From: "tip-bot2 for Alexander Shishkin" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf/aux: Disallow aux_output for kernel events Cc: Alexander Shishkin , "Peter Zijlstra (Intel)" , Arnaldo Carvalho de Melo , David Ahern , Jiri Olsa , Linus Torvalds , Mark Rutland , Namhyung Kim , Stephane Eranian , Thomas Gleixner , Vince Weaver , Ingo Molnar , Borislav Petkov , linux-kernel@vger.kernel.org In-Reply-To: <20191030134731.5437-3-alexander.shishkin@linux.intel.com> References: <20191030134731.5437-3-alexander.shishkin@linux.intel.com> MIME-Version: 1.0 Message-ID: <157363958637.29376.6730701512874139098.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the perf/urgent branch of tip: Commit-ID: dce5affb94eb54edfff17727a6240a6a5d998666 Gitweb: https://git.kernel.org/tip/dce5affb94eb54edfff17727a6240a6a5d998666 Author: Alexander Shishkin AuthorDate: Wed, 30 Oct 2019 15:47:31 +02:00 Committer: Ingo Molnar CommitterDate: Wed, 13 Nov 2019 08:16:42 +01:00 perf/aux: Disallow aux_output for kernel events Commit ab43762ef0109 ("perf: Allow normal events to output AUX data") added 'aux_output' bit to the attribute structure, which relies on AUX events and grouping, neither of which is supported for the kernel events. This notwithstanding, attempts have been made to use it in the kernel code, suggesting the necessity of an explicit hard -EINVAL. Fix this by rejecting attributes with aux_output set for kernel events. Signed-off-by: Alexander Shishkin Signed-off-by: Peter Zijlstra (Intel) Cc: Arnaldo Carvalho de Melo Cc: David Ahern Cc: Jiri Olsa Cc: Linus Torvalds Cc: Mark Rutland Cc: Namhyung Kim Cc: Stephane Eranian Cc: Thomas Gleixner Cc: Vince Weaver Link: https://lkml.kernel.org/r/20191030134731.5437-3-alexander.shishkin@linux.intel.com Signed-off-by: Ingo Molnar --- kernel/events/core.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/events/core.c b/kernel/events/core.c index e18d8d3..7655441 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -11331,6 +11331,13 @@ perf_event_create_kernel_counter(struct perf_event_attr *attr, int cpu, struct perf_event *event; int err; + /* + * Grouping is not supported for kernel events, neither is 'AUX', + * make sure the caller's intentions are adjusted. + */ + if (attr->aux_output) + return ERR_PTR(-EINVAL); + event = perf_event_alloc(attr, cpu, task, NULL, NULL, overflow_handler, context, -1); if (IS_ERR(event)) {