[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-22a4ec729017ba613337a28f306f94ba5023fe2e@git.kernel.org>
Date: Tue, 18 Jan 2011 19:06:59 GMT
From: tip-bot for Oleg Nesterov <oleg@...hat.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, paulus@...ba.org, acme@...hat.com,
hpa@...or.com, mingo@...hat.com, stern@...land.harvard.edu,
a.p.zijlstra@...llo.nl, roland@...hat.com, fweisbec@...il.com,
tglx@...utronix.de, oleg@...hat.com, mingo@...e.hu,
prasad@...ux.vnet.ibm.com
Subject: [tip:perf/urgent] perf: Find_get_context: fix the per-cpu-counter check
Commit-ID: 22a4ec729017ba613337a28f306f94ba5023fe2e
Gitweb: http://git.kernel.org/tip/22a4ec729017ba613337a28f306f94ba5023fe2e
Author: Oleg Nesterov <oleg@...hat.com>
AuthorDate: Tue, 18 Jan 2011 17:10:08 +0100
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Tue, 18 Jan 2011 19:34:23 +0100
perf: Find_get_context: fix the per-cpu-counter check
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 <oleg@...hat.com>
Acked-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Alan Stern <stern@...land.harvard.edu>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Prasad <prasad@...ux.vnet.ibm.com>
Cc: Roland McGrath <roland@...hat.com>
Cc: gregkh@...e.de
Cc: stable@...nel.org
LKML-Reference: <20110118161008.GB693@...hat.com>
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 76be4c7..a962b19 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -2228,7 +2228,7 @@ find_get_context(struct pmu *pmu, struct task_struct *task, int cpu)
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);
--
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