lists.openwall.net   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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-048c852051d2bd5da54a4488bc1f16b0fc74c695@git.kernel.org>
Date:	Sat, 1 May 2010 11:54:41 GMT
From:	tip-bot for Tejun Heo <tj@...nel.org>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, acme@...hat.com, hpa@...or.com,
	mingo@...hat.com, peterz@...radead.org, paulus@....ibm.com,
	stable@...nel.org, tj@...nel.org, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perf/urgent] perf: Fix resource leak in failure path of perf_event_open()

Commit-ID:  048c852051d2bd5da54a4488bc1f16b0fc74c695
Gitweb:     http://git.kernel.org/tip/048c852051d2bd5da54a4488bc1f16b0fc74c695
Author:     Tejun Heo <tj@...nel.org>
AuthorDate: Sat, 1 May 2010 10:11:35 +0200
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Sat, 1 May 2010 13:11:25 +0200

perf: Fix resource leak in failure path of perf_event_open()

perf_event_open() kfrees event after init failure which doesn't
release all resources allocated by perf_event_alloc().  Use
free_event() instead.

Signed-off-by: Tejun Heo <tj@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Paul Mackerras <paulus@....ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: <stable@...nel.org>
LKML-Reference: <4BDBE237.1040809@...nel.org>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 kernel/perf_event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 2f3fbf8..3d1552d 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4897,7 +4897,7 @@ err_fput_free_put_context:
 
 err_free_put_context:
 	if (err < 0)
-		kfree(event);
+		free_event(event);
 
 err_put_context:
 	if (err < 0)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ