mirror of
https://github.com/torvalds/linux.git
synced 2024-11-11 14:42:24 +00:00
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>
This commit is contained in:
parent
e9aaac1ac3
commit
ee4ed6fa5a
@ -1379,8 +1379,9 @@ void facility_unavailable_exception(struct pt_regs *regs)
|
|||||||
if (!arch_irq_disabled_regs(regs))
|
if (!arch_irq_disabled_regs(regs))
|
||||||
local_irq_enable();
|
local_irq_enable();
|
||||||
|
|
||||||
pr_err("%sFacility '%s' unavailable, exception at 0x%lx, MSR=%lx\n",
|
pr_err_ratelimited(
|
||||||
hv ? "Hypervisor " : "", facility, regs->nip, regs->msr);
|
"%sFacility '%s' unavailable, exception at 0x%lx, MSR=%lx\n",
|
||||||
|
hv ? "Hypervisor " : "", facility, regs->nip, regs->msr);
|
||||||
|
|
||||||
if (user_mode(regs)) {
|
if (user_mode(regs)) {
|
||||||
_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
|
_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
|
||||||
|
Loading…
Reference in New Issue
Block a user