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: <20211007110543.564963-4-james.clark@arm.com>
Date:   Thu,  7 Oct 2021 12:05:42 +0100
From:   James Clark <james.clark@....com>
To:     acme@...nel.org, john.garry@...wei.com, ak@...ux.intel.com,
        linux-perf-users@...r.kernel.org
Cc:     Nick.Forrington@....com, Andrew.Kilroy@....com,
        James Clark <james.clark@....com>,
        Will Deacon <will@...nel.org>,
        Mathieu Poirier <mathieu.poirier@...aro.org>,
        Leo Yan <leo.yan@...aro.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...hat.com>,
        Namhyung Kim <namhyung@...nel.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH 3/3] perf tools: Enable strict JSON parsing

This is to ensure that the PMU event files can always be parsed by
other tools.

Testing
=======

 * There are no errors when parsing files for all architectures:
     # pmu-events/jevents nds32 pmu-events/arch/ test
     # pmu-events/jevents s390 pmu-events/arch/ test
     # pmu-events/jevents powerpc pmu-events/arch/ test
     # pmu-events/jevents arm64 pmu-events/arch/ test
     # pmu-events/jevents test pmu-events/arch/ test
     # pmu-events/jevents x86 pmu-events/arch/ test

 * Trailing and leading commas now cause a parse error

 * Double commas now cause a parse error

 * Compilation and parsing works with strict mode disabled and enabled

 * A diff of the output files shows no changes

Signed-off-by: James Clark <james.clark@....com>
---
 tools/perf/pmu-events/jsmn.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/pmu-events/jsmn.c b/tools/perf/pmu-events/jsmn.c
index 8124d2d3ff0c..831dc44c4558 100644
--- a/tools/perf/pmu-events/jsmn.c
+++ b/tools/perf/pmu-events/jsmn.c
@@ -24,6 +24,7 @@
 
 #include <stdlib.h>
 #include "jsmn.h"
+#define JSMN_STRICT
 
 /*
  * Allocates a fresh unused token from the token pool.
-- 
2.28.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ