From: Thomas Gleixner <t...@linutronix.de>

Due to the hrtimer self rearming mode a user can DoS the machine simply
because it's starved by hrtimer events.

The RTC hrtimer is self rearming.  We really need to limit the frequency
to something sensible.

Signed-off-by: Thomas Gleixner <t...@linutronix.de>
Cc: John Stultz <john.stu...@linaro.org>
Cc: Ingo Molnar <mi...@elte.hu>
Cc: Ben Greear <gree...@candelatech.com>
Cc: <sta...@kernel.org>
Signed-off-by: Andrew Morton <a...@linux-foundation.org>
---

 drivers/rtc/interface.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/rtc/interface.c~rtc-limit-frequency drivers/rtc/interface.c
--- a/drivers/rtc/interface.c~rtc-limit-frequency
+++ a/drivers/rtc/interface.c
@@ -688,7 +688,7 @@ int rtc_irq_set_freq(struct rtc_device *
        int err = 0;
        unsigned long flags;
 
-       if (freq <= 0)
+       if (freq <= 0 || freq > 5000)
                return -EINVAL;
 
        spin_lock_irqsave(&rtc->irq_task_lock, flags);
_

_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to