mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-03 01:36:52 +09:00
Merge tag 'perf_urgent_for_v5.17_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fix from Borislav Petkov: "Prevent cgroup event list corruption when switching events" * tag 'perf_urgent_for_v5.17_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Fix list corruption in perf_cgroup_switch()
This commit is contained in:
@@ -839,7 +839,7 @@ static DEFINE_PER_CPU(struct list_head, cgrp_cpuctx_list);
|
||||
*/
|
||||
static void perf_cgroup_switch(struct task_struct *task, int mode)
|
||||
{
|
||||
struct perf_cpu_context *cpuctx;
|
||||
struct perf_cpu_context *cpuctx, *tmp;
|
||||
struct list_head *list;
|
||||
unsigned long flags;
|
||||
|
||||
@@ -850,7 +850,7 @@ static void perf_cgroup_switch(struct task_struct *task, int mode)
|
||||
local_irq_save(flags);
|
||||
|
||||
list = this_cpu_ptr(&cgrp_cpuctx_list);
|
||||
list_for_each_entry(cpuctx, list, cgrp_cpuctx_entry) {
|
||||
list_for_each_entry_safe(cpuctx, tmp, list, cgrp_cpuctx_entry) {
|
||||
WARN_ON_ONCE(cpuctx->ctx.nr_cgroups == 0);
|
||||
|
||||
perf_ctx_lock(cpuctx, cpuctx->task_ctx);
|
||||
|
||||
Reference in New Issue
Block a user