Commit 68f05b25 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'perf-urgent-2024-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull perf fix from Thomas Gleixner:
 "perf_event_clear_cpumask() uses list_for_each_entry_rcu() without
  being in a RCU read side critical section, which triggers a
  'suspicious RCU usage' warning.

  It turns out that the list walk does not be RCU protected because the
  write side lock is held in this context.

  Change it to a regular list walk"

* tag 'perf-urgent-2024-11-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf: Fix missing RCU reader protection in perf_event_clear_cpumask()
parents 8f0b844a e3dfd64c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13959,7 +13959,7 @@ static void perf_event_clear_cpumask(unsigned int cpu)
	}

	/* migrate */
	list_for_each_entry_rcu(pmu, &pmus, entry, lockdep_is_held(&pmus_srcu)) {
	list_for_each_entry(pmu, &pmus, entry) {
		if (pmu->scope == PERF_PMU_SCOPE_NONE ||
		    WARN_ON_ONCE(pmu->scope >= PERF_PMU_MAX_SCOPE))
			continue;