This is a note to let you know that I've just added the patch titled
perf: Find_get_context: fix the per-cpu-counter check
to the 2.6.37-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
perf-find_get_context-fix-the-per-cpu-counter-check.patch
and it can be found in the queue-2.6.37 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 22a4ec729017ba613337a28f306f94ba5023fe2e Mon Sep 17 00:00:00 2001
From: Oleg Nesterov <[email protected]>
Date: Tue, 18 Jan 2011 17:10:08 +0100
Subject: perf: Find_get_context: fix the per-cpu-counter check
From: Oleg Nesterov <[email protected]>
commit 22a4ec729017ba613337a28f306f94ba5023fe2e upstream.
If task == NULL, find_get_context() should always check that cpu
is correct.
Afaics, the bug was introduced by 38a81da2 "perf events: Clean
up pid passing", but even before that commit "&& cpu != -1" was
not exactly right, -ESRCH from find_task_by_vpid() is not
accurate.
Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Cc: Alan Stern <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Prasad <[email protected]>
Cc: Roland McGrath <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
kernel/perf_event.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -2100,7 +2100,7 @@ find_get_context(struct pmu *pmu, struct
unsigned long flags;
int ctxn, err;
- if (!task && cpu != -1) {
+ if (!task) {
/* Must be root to operate on a CPU event: */
if (perf_paranoid_cpu() && !capable(CAP_SYS_ADMIN))
return ERR_PTR(-EACCES);
Patches currently in stable-queue which might be from [email protected] are
queue-2.6.37/perf-validate-cpu-early-in-perf_event_alloc.patch
queue-2.6.37/ptrace-use-safer-wake-up-on-ptrace_detach.patch
queue-2.6.37/perf-find_get_context-fix-the-per-cpu-counter-check.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable