From 45f5c863511bf594e589c11638040f9cec857802 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 19 Sep 2025 18:58:55 +0200 Subject: [PATCH] 6.12-stable patches added patches: perf-x86-intel-fix-crash-in-icl_update_topdown_event.patch --- ...ix-crash-in-icl_update_topdown_event.patch | 67 +++++++++++++++++++ queue-6.12/series | 1 + 2 files changed, 68 insertions(+) create mode 100644 queue-6.12/perf-x86-intel-fix-crash-in-icl_update_topdown_event.patch diff --git a/queue-6.12/perf-x86-intel-fix-crash-in-icl_update_topdown_event.patch b/queue-6.12/perf-x86-intel-fix-crash-in-icl_update_topdown_event.patch new file mode 100644 index 0000000000..6b41910352 --- /dev/null +++ b/queue-6.12/perf-x86-intel-fix-crash-in-icl_update_topdown_event.patch @@ -0,0 +1,67 @@ +From b0823d5fbacb1c551d793cbfe7af24e0d1fa45ed Mon Sep 17 00:00:00 2001 +From: Kan Liang +Date: Thu, 12 Jun 2025 07:38:18 -0700 +Subject: perf/x86/intel: Fix crash in icl_update_topdown_event() + +From: Kan Liang + +commit b0823d5fbacb1c551d793cbfe7af24e0d1fa45ed upstream. + +The perf_fuzzer found a hard-lockup crash on a RaptorLake machine: + + Oops: general protection fault, maybe for address 0xffff89aeceab400: 0000 + CPU: 23 UID: 0 PID: 0 Comm: swapper/23 + Tainted: [W]=WARN + Hardware name: Dell Inc. Precision 9660/0VJ762 + RIP: 0010:native_read_pmc+0x7/0x40 + Code: cc e8 8d a9 01 00 48 89 03 5b cd cc cc cc cc 0f 1f ... + RSP: 000:fffb03100273de8 EFLAGS: 00010046 + .... + Call Trace: + + icl_update_topdown_event+0x165/0x190 + ? ktime_get+0x38/0xd0 + intel_pmu_read_event+0xf9/0x210 + __perf_event_read+0xf9/0x210 + +CPUs 16-23 are E-core CPUs that don't support the perf metrics feature. +The icl_update_topdown_event() should not be invoked on these CPUs. + +It's a regression of commit: + + f9bdf1f95339 ("perf/x86/intel: Avoid disable PMU if !cpuc->enabled in sample read") + +The bug introduced by that commit is that the is_topdown_event() function +is mistakenly used to replace the is_topdown_count() call to check if the +topdown functions for the perf metrics feature should be invoked. + +Fix it. + +Fixes: f9bdf1f95339 ("perf/x86/intel: Avoid disable PMU if !cpuc->enabled in sample read") +Closes: https://lore.kernel.org/lkml/352f0709-f026-cd45-e60c-60dfd97f73f3@maine.edu/ +Reported-by: Vince Weaver +Signed-off-by: Kan Liang +Signed-off-by: Peter Zijlstra (Intel) +Signed-off-by: Ingo Molnar +Tested-by: Vince Weaver +Cc: stable@vger.kernel.org # v6.15+ +Link: https://lore.kernel.org/r/20250612143818.2889040-1-kan.liang@linux.intel.com +[ omitted PEBS check ] +Signed-off-by: Sasha Levin +Signed-off-by: Angel Adetula +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/events/intel/core.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/x86/events/intel/core.c ++++ b/arch/x86/events/intel/core.c +@@ -2793,7 +2793,7 @@ static void intel_pmu_read_event(struct + if (pmu_enabled) + intel_pmu_disable_all(); + +- if (is_topdown_event(event)) ++ if (is_topdown_count(event)) + static_call(intel_pmu_update_topdown_event)(event); + else + intel_pmu_drain_pebs_buffer(); diff --git a/queue-6.12/series b/queue-6.12/series index 1756723818..996d2b672d 100644 --- a/queue-6.12/series +++ b/queue-6.12/series @@ -30,3 +30,4 @@ revert-net-mlx5e-update-and-set-xon-xoff-upon-port-s.patch net-liquidio-fix-overflow-in-octeon_init_instr_queue.patch cnic-fix-use-after-free-bugs-in-cnic_delete_task.patch octeontx2-pf-fix-use-after-free-bugs-in-otx2_sync_ts.patch +perf-x86-intel-fix-crash-in-icl_update_topdown_event.patch -- 2.47.3