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  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]
Date:   Sat, 9 Mar 2019 12:09:11 -0800
From:   tip-bot for Jiri Olsa <>
Subject: [tip:perf/urgent] perf session: Fix double free in perf_data__close

Commit-ID:  befa09b61f8bf1d7c34b8e6405f08d804640573c
Author:     Jiri Olsa <>
AuthorDate: Tue, 5 Mar 2019 16:25:35 +0100
Committer:  Arnaldo Carvalho de Melo <>
CommitDate: Wed, 6 Mar 2019 18:20:33 -0300

perf session: Fix double free in perf_data__close

We can't call perf_data__close and subsequently perf_session__delete,
because it will call perf_data__close again and cause double free for

  $ perf report -i .
  incompatible file format (rerun with -v to learn more)
  free(): double free detected in tcache 2
  Aborted (core dumped)

In fact we don't need to call perf_data__close at all, because at the
time the got out_close is reached, session->data is already initialized,
so the perf_data__close call will be triggered from

Signed-off-by: Jiri Olsa <>
Cc: Alexander Shishkin <>
Cc: Andi Kleen <>
Cc: Jonas Rabenstein <>
Cc: Nageswara R Sastry <>
Cc: Namhyung Kim <>
Cc: Peter Zijlstra <>
Cc: Ravi Bangoria <>
Fixes: 2d4f27999b88 ("perf data: Add global path holder")
Signed-off-by: Arnaldo Carvalho de Melo <>
 tools/perf/util/session.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index c764bbc91009..db643f3c2b95 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -140,7 +140,7 @@ struct perf_session *perf_session__new(struct perf_data *data,
 		if (perf_data__is_read(data)) {
 			if (perf_session__open(session) < 0)
-				goto out_close;
+				goto out_delete;
 			 * set session attributes that are present in
@@ -181,8 +181,6 @@ struct perf_session *perf_session__new(struct perf_data *data,
 	return session;
- out_close:
-	perf_data__close(data);

Powered by blists - more mailing lists