diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-27 13:08:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-27 13:08:09 -0400 |
commit | e09d13c4c8805546d97bcc8c508c07f7d8f4c8e8 (patch) | |
tree | 49304cce7cbc67dd188bd35183b89f664343ec27 | |
parent | d7d7271f421f1e45289f2a737c7f636c02c673ce (diff) | |
parent | c79aa0d96548aee50570209eb2d45c8f4ac49230 (diff) |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fix from Ingo Molnar:
"This fix adds missing RCU read protection"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
events: Protect access via task_subsys_state_check()
-rw-r--r-- | kernel/events/core.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 4d3124b39277..9fcb0944f071 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -4596,6 +4596,7 @@ void perf_event_comm(struct task_struct *task) | |||
4596 | struct perf_event_context *ctx; | 4596 | struct perf_event_context *ctx; |
4597 | int ctxn; | 4597 | int ctxn; |
4598 | 4598 | ||
4599 | rcu_read_lock(); | ||
4599 | for_each_task_context_nr(ctxn) { | 4600 | for_each_task_context_nr(ctxn) { |
4600 | ctx = task->perf_event_ctxp[ctxn]; | 4601 | ctx = task->perf_event_ctxp[ctxn]; |
4601 | if (!ctx) | 4602 | if (!ctx) |
@@ -4603,6 +4604,7 @@ void perf_event_comm(struct task_struct *task) | |||
4603 | 4604 | ||
4604 | perf_event_enable_on_exec(ctx); | 4605 | perf_event_enable_on_exec(ctx); |
4605 | } | 4606 | } |
4607 | rcu_read_unlock(); | ||
4606 | 4608 | ||
4607 | if (!atomic_read(&nr_comm_events)) | 4609 | if (!atomic_read(&nr_comm_events)) |
4608 | return; | 4610 | return; |