Commit 83bfd26d authored by Ian Rogers's avatar Ian Rogers Committed by Luo Gengkun
Browse files

perf report: Fix memory leaks around perf_tip()

mainline inclusion
from mainline-v5.16-rc2
commit d9fc7061
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9S202
CVE: CVE-2021-47543

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d9fc706108c15f8bc2d4ccccf8e50f74830fabd9



--------------------------------

perf_tip() may allocate memory or use a literal, this means memory
wasn't freed if allocated. Change the API so that literals aren't used.

At the same time add missing frees for system_path. These issues were
spotted using leak sanitizer.

Signed-off-by: default avatarIan Rogers <irogers@google.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
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>
Link: http://lore.kernel.org/lkml/20211118073804.2149974-1-irogers@google.com


Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>

Conflicts:
	tools/perf/builtin-report.c
[fix context conflicts]
Signed-off-by: default avatarLuo Gengkun <luogengkun2@huawei.com>
parent aec28351
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment