linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf/x86: Fix NULL dereference in handle_pmi_common()
@ 2025-12-12 16:51 Tinu K Cheriya
  0 siblings, 0 replies; only message in thread
From: Tinu K Cheriya @ 2025-12-12 16:51 UTC (permalink / raw)
  To: peterz; +Cc: acme, tglx, linux-perf-users, linux-kernel, Tinu K Cheriya

syzbot reported a NULL pointer dereference in handle_pmi_common()
when the event pointer retrieved from cpuc->events[] is NULL but
is_pebs_counter_event_group() is called unconditionally.

Add a defensive NULL check before calling is_pebs_counter_event_group().

bug:220855

Signed-off-by: Tinu K Cheriya <tinuk11c@gmail.com>
---
 arch/x86/events/intel/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
index 1e3ce060d..ee693946d 100644
--- a/arch/x86/events/intel/core.c
+++ b/arch/x86/events/intel/core.c
@@ -3397,7 +3397,7 @@ static int handle_pmi_common(struct pt_regs *regs, u64 status)
 		 *
 		 * The PEBS buffer has to be drained before handling the A-PMI
 		 */
-		if(!event)
+		if (!event)
 			continue;
 		if (is_pebs_counter_event_group(event))
 			static_call(x86_pmu_drain_pebs)(regs, &data);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-12-12 16:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-12 16:51 [PATCH] perf/x86: Fix NULL dereference in handle_pmi_common() Tinu K Cheriya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).