Skip to contentSkip to conversation

powerpc: ratelimit users spamming kernel log buffer

PATCH New Michael Neuling 1 participant 1 message Mar 14, 2014 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: ratelimit users spamming kernel log buffer

The facility unavailable exception can be triggered from userspace by accessing PMU registers when EBB is not enabled. This causes the included pr_err() to run, hence spamming the kernel log buffer.

This avoids this by rate limiting these messages.

---
We can bike shed the hell out of this one. We could just remove it, or we could put it under the control of show_unhandled_signals.

arch/powerpc/kernel/traps.c +3 -2
index e435bc0..7836de3f 100644
@@ -1340,8 +1340,9 @@ void facility_unavailable_exception(struct pt_regs *regs)
 	if (!arch_irq_disabled_regs(regs))
 		local_irq_enable();
 
-	pr_err("%sFacility '%s' unavailable, exception at 0x%lx, MSR=%lx\n",
-	       hv ? "Hypervisor " : "", facility, regs->nip, regs->msr);
+	pr_err_ratelimited(
+		"%sFacility '%s' unavailable, exception at 0x%lx, MSR=%lx\n",
+		hv ? "Hypervisor " : "", facility, regs->nip, regs->msr);
 
 	if (user_mode(regs)) {
 		_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);