[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-201c2f85bd0bc13b712d9c0b3d11251b182e06ae@git.kernel.org>
Date: Thu, 31 Mar 2016 02:19:05 -0700
From: tip-bot for Alexander Shishkin <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: jolsa@...hat.com, acme@...nel.org, tglx@...utronix.de,
vincent.weaver@...ne.edu, alexander.shishkin@...ux.intel.com,
hpa@...or.com, acme@...hat.com, chianglungyu@...il.com,
linux-kernel@...r.kernel.org, eranian@...gle.com, mingo@...nel.org,
torvalds@...ux-foundation.org, peterz@...radead.org
Subject: [tip:perf/core] perf/core: Don't leak event in the syscall error
path
Commit-ID: 201c2f85bd0bc13b712d9c0b3d11251b182e06ae
Gitweb: http://git.kernel.org/tip/201c2f85bd0bc13b712d9c0b3d11251b182e06ae
Author: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
AuthorDate: Mon, 21 Mar 2016 10:02:42 +0200
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Thu, 31 Mar 2016 09:54:07 +0200
perf/core: Don't leak event in the syscall error path
In the error path, event_file not being NULL is used to determine
whether the event itself still needs to be free'd, so fix it up to
avoid leaking.
Reported-by: Leon Yu <chianglungyu@...il.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Fixes: 130056275ade ("perf: Do not double free")
Link: http://lkml.kernel.org/r/87twk06yxp.fsf@ashishki-desk.ger.corp.intel.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/events/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/events/core.c b/kernel/events/core.c
index 8c11388..52bedc5 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -8542,6 +8542,7 @@ SYSCALL_DEFINE5(perf_event_open,
f_flags);
if (IS_ERR(event_file)) {
err = PTR_ERR(event_file);
+ event_file = NULL;
goto err_context;
}
Powered by blists - more mailing lists