[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b65cf4c6-3484-85c8-d191-35021ed6ed3e@intel.com>
Date: Wed, 3 Jul 2019 08:19:19 +0300
From: Adrian Hunter <adrian.hunter@...el.com>
To: Leo Yan <leo.yan@...aro.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Suzuki K Poulose <suzuki.poulose@....com>,
Andi Kleen <ak@...ux.intel.com>,
"David S. Miller" <davem@...emloft.net>,
Davidlohr Bueso <dave@...olabs.net>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Jin Yao <yao.jin@...ux.intel.com>,
Song Liu <songliubraving@...com>,
Alexios Zavras <alexios.zavras@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Changbin Du <changbin.du@...el.com>,
Eric Saint-Etienne <eric.saint.etienne@...cle.com>,
Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
Thomas Richter <tmricht@...ux.ibm.com>,
Alexey Budankov <alexey.budankov@...ux.intel.com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH v1 10/11] perf intel-pt: Smatch: Fix potential NULL
pointer dereference
On 3/07/19 4:35 AM, Leo Yan wrote:
> Hi Adrian,
>
> On Tue, Jul 02, 2019 at 02:07:40PM +0300, Adrian Hunter wrote:
>> On 2/07/19 1:34 PM, Leo Yan wrote:
>>> Based on the following report from Smatch, fix the potential
>>> NULL pointer dereference check.
>>
>> It never is NULL. Remove the NULL test if you want:
>>
>> - if (session->itrace_synth_opts && session->itrace_synth_opts->set) {
>> + if (session->itrace_synth_opts->set) {
>>
>> But blindly making changes like below is questionable.
>
> Thanks for suggestions.
>
> I checked report and script commands, as you said, both command will
> always set session->itrace_synth_opts. For these two commands, we can
> safely remove the NULL test.
>
> Because perf tool contains many sub commands, so I don't have much
> confidence it's very safe to remove the NULL test for all cases; e.g.
> there have cases which will process aux trace buffer but without
> itrace options; for this case, session->itrace_synth_opts might be NULL.
>
> For either way (remove NULL test or keep NULL test), I don't want to
> introduce regression and extra efforts by my patch. So want to double
> confirm with you for this :)
Yes, intel_pt_process_auxtrace_info() only gets called if a tool sets up the
tools->auxtrace_info() callback. The tools that do that also set
session->itrace_synth_opts.
Powered by blists - more mailing lists