diff options
author | Michael Neuling <mikey@neuling.org> | 2014-03-14 02:03:58 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-03-23 18:48:34 -0400 |
commit | ee4ed6fa5af0009a1205498d1f754fecc7af7657 (patch) | |
tree | 5eaa6e13a2d83e39bb66fe74585328dd7edd02c4 /arch/powerpc/kernel/traps.c | |
parent | e9aaac1ac39f58a897e9b71e153317c8c216cb21 (diff) |
powerpc: Rate-limit 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.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/traps.c')
-rw-r--r-- | arch/powerpc/kernel/traps.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 33cd7a0b8e73..df86f0ce2d36 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
@@ -1379,8 +1379,9 @@ void facility_unavailable_exception(struct pt_regs *regs) | |||
1379 | if (!arch_irq_disabled_regs(regs)) | 1379 | if (!arch_irq_disabled_regs(regs)) |
1380 | local_irq_enable(); | 1380 | local_irq_enable(); |
1381 | 1381 | ||
1382 | pr_err("%sFacility '%s' unavailable, exception at 0x%lx, MSR=%lx\n", | 1382 | pr_err_ratelimited( |
1383 | hv ? "Hypervisor " : "", facility, regs->nip, regs->msr); | 1383 | "%sFacility '%s' unavailable, exception at 0x%lx, MSR=%lx\n", |
1384 | hv ? "Hypervisor " : "", facility, regs->nip, regs->msr); | ||
1384 | 1385 | ||
1385 | if (user_mode(regs)) { | 1386 | if (user_mode(regs)) { |
1386 | _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); | 1387 | _exception(SIGILL, regs, ILL_ILLOPC, regs->nip); |