Re: [PATCH AUTOSEL 4.14 112/127] perf parse-events: Fix incorrect conversion of 'if () free()' to 'zfree()'

Sasha Levin
2020-09-28T23:20:36Z

On Tue, Sep 29, 2020 at 01:24:32AM +0530, Naresh Kamboju wrote:
>On Fri, 18 Sep 2020 at 08:00, Sasha Levin <sashal@kernel.org> wrote:
>>
>> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>>
>> [ Upstream commit 7fcdccd4237724931d9773d1e3039bfe053a6f52 ]
>>
>> When applying a patch by Ian I incorrectly converted to zfree() an
>> expression that involved testing some other struct member, not the one
>> being freed, which lead to bugs reproduceable by:
>>
>> $ perf stat -e i/bs,tsc,L2/o sleep 1
>> WARNING: multiple event parsing errors
>> Segmentation fault (core dumped)
>> $
>>
>> Fix it by restoring the test for pos->free_str before freeing
>> pos->val.str, but continue using zfree(&pos->val.str) to set that member
>> to NULL after freeing it.
>>
>> Reported-by: Ian Rogers <irogers@google.com>
>> Fixes: e8dfb81838b1 ("perf parse-events: Fix memory leaks found on parse_events")
>> Cc: Adrian Hunter <adrian.hunter@intel.com>
>> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
>> Cc: Andi Kleen <ak@linux.intel.com>
>> Cc: clang-built-linux@googlegroups.com
>> Cc: Jiri Olsa <jolsa@kernel.org>
>> Cc: Leo Yan <leo.yan@linaro.org>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Cc: Namhyung Kim <namhyung@kernel.org>
>> Cc: Peter Zijlstra <peterz@infradead.org>
>> Cc: Stephane Eranian <eranian@google.com>
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>
>stable rc 4.14 perf build broken.

Dropped, thanks!

--
Thanks,
Sasha