public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] perf_event: add check for group_list if the parent isn't counted
@ 2009-12-30 11:28 Liming Wang
  2009-12-30 12:28 ` Peter Zijlstra
  0 siblings, 1 reply; 6+ messages in thread
From: Liming Wang @ 2009-12-30 11:28 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Frederic Weisbecker, Paul Mackerras, Thomas Gleixner,
	Peter Zijlstra, linux-kernel, Liming Wang

If the parent has no entry in group_list, child_ctx will not be
allocated, which will lead dereference of a NULL child_ctx.

Signed-off-by: Liming Wang <liming.wang@windriver.com>
---
 kernel/perf_event.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 5b987b4..3664c4b 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -5126,6 +5126,8 @@ int perf_event_init_task(struct task_struct *child)
 	 */
 	mutex_lock(&parent_ctx->mutex);
 
+	if (list_empty(&parent_ctx->group_list))
+		goto exit;
 	/*
 	 * We dont have to disable NMIs - we are only looking at
 	 * the list, not manipulating it:
-- 
1.6.0.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-12-31 14:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-30 11:28 [PATCH 1/1] perf_event: add check for group_list if the parent isn't counted Liming Wang
2009-12-30 12:28 ` Peter Zijlstra
2009-12-30 14:36   ` Wang Liming
2009-12-30 15:08     ` Peter Zijlstra
2009-12-30 15:02       ` Wang Liming
2009-12-31 14:30       ` [tip:perf/urgent] perf: Fix NULL deref in inheritance code tip-bot for Peter Zijlstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox