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-next>] [day] [month] [year] [list]
Message-Id: <20220901184709.2179309-1-robh@kernel.org>
Date:   Thu,  1 Sep 2022 13:47:10 -0500
From:   Rob Herring <robh@...nel.org>
To:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>
Cc:     James Clark <james.clark@....com>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] perf: Ignore format attributes with an unknown perf_event_attr field

If the kernel exposes a new perf_event_attr field in a format attr, perf
will return an error stating the specified PMU can't be found. For
example, a format attr with 'config3:0-63' causes an error if config3 is
unknown to perf. This causes a compatibility issue between a newer
kernel and an older perf tool.

The addition here makes any attr string up to the ':' ignored, but
still checks the 'bits' portion.

Signed-off-by: Rob Herring <robh@...nel.org>
---
This is the YACC mud I threw and seems to stick. Maybe there's a better 
way to handle this. It doesn't seem like there's a way to do wildcards 
(i.e. config.*) in YACC.

This is needed for this series[1]. Unfortunately the best we do to avoid 
the issue is applying this to stable. I think there's some time before 
v8.7 h/w is deployed, too.

Rob

[1] https://lore.kernel.org/all/20220825-arm-spe-v8-7-v1-0-c75b8d92e692@kernel.org/

 tools/perf/util/pmu.y | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/pmu.y b/tools/perf/util/pmu.y
index bfd7e8509869..3096864ec9b9 100644
--- a/tools/perf/util/pmu.y
+++ b/tools/perf/util/pmu.y
@@ -60,6 +60,9 @@ PP_CONFIG2 ':' bits
 				      PERF_PMU_FORMAT_VALUE_CONFIG2,
 				      $3));
 }
+|
+error ':' bits
+{}
 
 bits:
 bits ',' bit_term
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ