Skip to contentSkip to conversation

perf fixes

GIT PULL Merged Ingo Molnar 2 participants 2 messages Mar 21, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest perf/urgent git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-2021-03-21

# HEAD: 2dc0572f2cef87425147658698dce2600b799bd3 perf/x86/intel: Fix unchecked MSR access error caused by VLBR_EVENT

Boundary condition fixes for bugs unearthed by the perf fuzzer.

Thanks,

Ingo

------------------>
Kan Liang (2):
perf/x86/intel: Fix a crash caused by zero PEBS status perf/x86/intel: Fix unchecked MSR access error caused by VLBR_EVENT

 arch/x86/events/intel/core.c | 3 +++
 arch/x86/events/intel/ds.c   | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/x86/events/intel/core.c +3 -0
index 7bbb5bb98d8c..37ce38403cb8 100644
@@ -3659,6 +3659,9 @@ static int intel_pmu_hw_config(struct perf_event *event)
 		return ret;
 
 	if (event->attr.precise_ip) {
+		if ((event->attr.config & INTEL_ARCH_EVENT_MASK) == INTEL_FIXED_VLBR_EVENT)
+			return -EINVAL;
+
 		if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) {
 			event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD;
 			if (!(event->attr.sample_type &
arch/x86/events/intel/ds.c +1 -1
index 7ebae1826403..d32b302719fe 100644
@@ -2010,7 +2010,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs, struct perf_sample_d
 		 */
 		if (!pebs_status && cpuc->pebs_enabled &&
 			!(cpuc->pebs_enabled & (cpuc->pebs_enabled-1)))
-			pebs_status = cpuc->pebs_enabled;
+			pebs_status = p->status = cpuc->pebs_enabled;
 
 		bit = find_first_bit((unsigned long *)&pebs_status,
 					x86_pmu.max_pebs_events);
merge bot Merged
#1 lore raw
The pull request you sent on Sun, 21 Mar 2021 11:56:36 +0100:

The pull request you sent on Sun, 21 Mar 2021 11:56:36 +0100:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf-urgent-2021-03-21

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/1c74516c2da40ead2c22c4ac07c117c20f9c31ec

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html