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: <883a0115-57f4-0bc3-9161-e5efc6a1a9d0@linux.ibm.com>
Date:   Wed, 20 Jun 2018 19:39:36 +0530
From:   Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
To:     Arnaldo Carvalho de Melo <acme@...nel.org>
Cc:     jolsa@...hat.com, alexander.shishkin@...ux.intel.com,
        namhyung@...nel.org, dsahern@...il.com, ak@...ux.intel.com,
        yao.jin@...ux.intel.com, linux-kernel@...r.kernel.org,
        Ravi Bangoria <ravi.bangoria@...ux.ibm.com>
Subject: Re: [PATCH 3/3] perf script: Fix crash because of missing feat_op[]
 entry

Hi Arnaldo,

On 06/20/2018 07:19 PM, Arnaldo Carvalho de Melo wrote:
> Em Wed, Jun 20, 2018 at 07:00:30PM +0530, Ravi Bangoria escreveu:
>> perf_event__process_feature() tries to access feat_ops[feat].process
>> which is not defined for feat = HEADER_LAST_FEATURE and thus perf is
>> crashing. Add dummy entry for HEADER_LAST_FEATURE in the feat_ops.
> 
> Humm, first impression is that we should check for HEADER_LAST_FEATURE
> and not try to access that array slot, as it is just a marker, not an
> actual feature.

Sure. Let me try to handle it inside perf_event__process_feature() itself.
May be something like below.

-----
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 540cd2dcd3e7..4dc251d3b372 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -3461,6 +3461,10 @@ int perf_event__process_feature(struct perf_tool *tool,
                return -1;
        }
 
+       /* HEADER_LAST_FEATURE is just a marker. Ignore it. */
+       if (feat == HEADER_LAST_FEATURE)
+               return 0;
+
        if (!feat_ops[feat].process)
                return 0;
-----

Thanks,
Ravi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ