Skip to content

Commit 1c74516

Browse files
committed
Merge tag 'perf-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Ingo Molnar: "Boundary condition fixes for bugs unearthed by the perf fuzzer" * tag 'perf-urgent-2021-03-21' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf/x86/intel: Fix unchecked MSR access error caused by VLBR_EVENT perf/x86/intel: Fix a crash caused by zero PEBS status
2 parents 5ba33b4 + 2dc0572 commit 1c74516

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

arch/x86/events/intel/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3659,6 +3659,9 @@ static int intel_pmu_hw_config(struct perf_event *event)
36593659
return ret;
36603660

36613661
if (event->attr.precise_ip) {
3662+
if ((event->attr.config & INTEL_ARCH_EVENT_MASK) == INTEL_FIXED_VLBR_EVENT)
3663+
return -EINVAL;
3664+
36623665
if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) {
36633666
event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD;
36643667
if (!(event->attr.sample_type &

arch/x86/events/intel/ds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs, struct perf_sample_d
20102010
*/
20112011
if (!pebs_status && cpuc->pebs_enabled &&
20122012
!(cpuc->pebs_enabled & (cpuc->pebs_enabled-1)))
2013-
pebs_status = cpuc->pebs_enabled;
2013+
pebs_status = p->status = cpuc->pebs_enabled;
20142014

20152015
bit = find_first_bit((unsigned long *)&pebs_status,
20162016
x86_pmu.max_pebs_events);

0 commit comments

Comments
 (0)