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  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:	Fri,  8 Aug 2014 13:38:55 -0700
From:	Kamal Mostafa <>
Cc:	Jiri Olsa <>,
	Peter Zijlstra <>,
	Arnaldo Carvalho de Melo <>,
	Paul Mackerras <>,
	Frederic Weisbecker <>,
	Namhyung Kim <>,
	Corey Ashford <>,
	David Ahern <>, Jiri Olsa <>,
	Linus Torvalds <>,
	Ingo Molnar <>,
	Kamal Mostafa <>
Subject: [PATCH 3.13 112/259] perf: Do not allow optimized switch for non-cloned events -stable review patch.  If anyone has any objections, please let me know.


From: Jiri Olsa <>

commit 1f9a7268c67f0290837aada443d28fd953ddca90 upstream.

The context check in perf_event_context_sched_out allows
non-cloned context to be part of the optimized schedule
out switch.

This could move non-cloned context into another workload
child. Once this child exits, the context is closed and
leaves all original (parent) events in closed state.

Any other new cloned event will have closed state and not
measure anything. And probably causing other odd bugs.

Signed-off-by: Jiri Olsa <>
Signed-off-by: Peter Zijlstra <>
Cc: Arnaldo Carvalho de Melo <>
Cc: Paul Mackerras <>
Cc: Frederic Weisbecker <>
Cc: Namhyung Kim <>
Cc: Paul Mackerras <>
Cc: Corey Ashford <>
Cc: David Ahern <>
Cc: Jiri Olsa <>
Cc: Linus Torvalds <>
Signed-off-by: Ingo Molnar <>
Signed-off-by: Kamal Mostafa <>
 kernel/events/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index f0a8ac7..f8519d6 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -2296,7 +2296,7 @@ static void perf_event_context_sched_out(struct task_struct *task, int ctxn,
 	next_parent = rcu_dereference(next_ctx->parent_ctx);
 	/* If neither context have a parent context; they cannot be clones. */
-	if (!parent && !next_parent)
+	if (!parent || !next_parent)
 		goto unlock;
 	if (next_parent == ctx || next_ctx == parent || next_parent == parent) {

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists