perf/x86: Fix NULL dereference in handle_pmi_common()
Subsystems (2)
PATCH 1/1 perf/x86: Fix NULL dereference in handle_pmi_common()
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 <[email protected]>
--- arch/x86/events/intel/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/events/intel/core.c +1 -1
@@ -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);
Signature · 1 line
2.34.1