lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221003070723.875461580@linuxfoundation.org>
Date:   Mon,  3 Oct 2022 09:11:40 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     linux-kernel@...r.kernel.org
Cc:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        stable@...r.kernel.org, Ian Rogers <irogers@...gle.com>,
        Andi Kleen <ak@...ux.intel.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Alexander Antonov <alexander.antonov@...ux.intel.com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Andrew Kilroy <andrew.kilroy@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Changbin Du <changbin.du@...el.com>,
        Denys Zagorui <dzagorui@...co.com>,
        Fabian Hemmer <copy@...y.sh>, Felix Fietkau <nbd@....name>,
        Heiko Carstens <hca@...ux.ibm.com>,
        Ingo Molnar <mingo@...hat.com>,
        Jacob Keller <jacob.e.keller@...el.com>,
        Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>,
        Jin Yao <yao.jin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Joakim Zhang <qiangqing.zhang@....com>,
        John Garry <john.garry@...wei.com>,
        Kajol Jain <kjain@...ux.ibm.com>,
        Kan Liang <kan.liang@...ux.intel.com>,
        Kees Kook <keescook@...omium.org>,
        Mark Rutland <mark.rutland@....com>,
        Namhyung Kim <namhyung@...nel.org>,
        Nicholas Fraser <nfraser@...eweavers.com>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Paul Clarke <pc@...ibm.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Riccardo Mancini <rickyman7@...il.com>,
        Sami Tolvanen <samitolvanen@...gle.com>,
        ShihCheng Tu <mrtoastcheng@...il.com>,
        Song Liu <songliubraving@...com>,
        Stephane Eranian <eranian@...gle.com>,
        Sumanth Korikkar <sumanthk@...ux.ibm.com>,
        Thomas Richter <tmricht@...ux.ibm.com>,
        Wan Jiabing <wanjiabing@...o.com>,
        Zhen Lei <thunder.leizhen@...wei.com>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        Sasha Levin <sashal@...nel.org>
Subject: [PATCH 5.15 75/83] perf parse-events: Identify broken modifiers

From: Ian Rogers <irogers@...gle.com>

[ Upstream commit eabd4523395e4a8f2b049165642801f2ab8ff893 ]

Previously the broken modifier causes a usage message to printed but
nothing else.

After:

  $ perf stat -e 'cycles:kk' -a sleep 2
  event syntax error: 'cycles:kk'
                              \___ Bad modifier
  Run 'perf list' for a list of valid events

   Usage: perf stat [<options>] [<command>]

      -e, --event <event>   event selector. use 'perf list' to list available events

  $ perf stat -e '{instructions,cycles}:kk' -a sleep 2
  event syntax error: '..ns,cycles}:kk'
                                    \___ Bad modifier
  Run 'perf list' for a list of valid events

   Usage: perf stat [<options>] [<command>]

      -e, --event <event>   event selector. use 'perf list' to list available events

Signed-off-by: Ian Rogers <irogers@...gle.com>
Acked-by: Andi Kleen <ak@...ux.intel.com>
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Alexander Antonov <alexander.antonov@...ux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Andrew Kilroy <andrew.kilroy@....com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: Changbin Du <changbin.du@...el.com>
Cc: Denys Zagorui <dzagorui@...co.com>
Cc: Fabian Hemmer <copy@...y.sh>
Cc: Felix Fietkau <nbd@....name>
Cc: Heiko Carstens <hca@...ux.ibm.com>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: Jacob Keller <jacob.e.keller@...el.com>
Cc: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Cc: Jin Yao <yao.jin@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Joakim Zhang <qiangqing.zhang@....com>
Cc: John Garry <john.garry@...wei.com>
Cc: Kajol Jain <kjain@...ux.ibm.com>
Cc: Kan Liang <kan.liang@...ux.intel.com>
Cc: Kees Kook <keescook@...omium.org>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Nicholas Fraser <nfraser@...eweavers.com>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>
Cc: Paul Clarke <pc@...ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Riccardo Mancini <rickyman7@...il.com>
Cc: Sami Tolvanen <samitolvanen@...gle.com>
Cc: ShihCheng Tu <mrtoastcheng@...il.com>
Cc: Song Liu <songliubraving@...com>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Sumanth Korikkar <sumanthk@...ux.ibm.com>
Cc: Thomas Richter <tmricht@...ux.ibm.com>
Cc: Wan Jiabing <wanjiabing@...o.com>
Cc: Zhen Lei <thunder.leizhen@...wei.com>
Link: https://lore.kernel.org/r/20211015172132.1162559-21-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Stable-dep-of: 71c86cda750b ("perf parse-events: Remove "not supported" hybrid cache events")
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
 tools/perf/util/parse-events.y | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index d94e48e1ff9b..467a426205a0 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -183,6 +183,11 @@ group_def ':' PE_MODIFIER_EVENT
 	err = parse_events__modifier_group(list, $3);
 	free($3);
 	if (err) {
+		struct parse_events_state *parse_state = _parse_state;
+		struct parse_events_error *error = parse_state->error;
+
+		parse_events__handle_error(error, @3.first_column,
+					   strdup("Bad modifier"), NULL);
 		free_list_evsel(list);
 		YYABORT;
 	}
@@ -240,6 +245,11 @@ event_name PE_MODIFIER_EVENT
 	err = parse_events__modifier_event(list, $2, false);
 	free($2);
 	if (err) {
+		struct parse_events_state *parse_state = _parse_state;
+		struct parse_events_error *error = parse_state->error;
+
+		parse_events__handle_error(error, @2.first_column,
+					   strdup("Bad modifier"), NULL);
 		free_list_evsel(list);
 		YYABORT;
 	}
-- 
2.35.1



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ