linux-3.0.x for AP-SH4A-0A Board
Revisão | ec054bbddbd0841174f4d5c3a4685eca9f9a9f93 (tree) |
---|---|
Hora | 2011-08-05 13:58:32 |
Autor | Thomas Gleixner <tglx@linu...> |
Commiter | Greg Kroah-Hartman |
rtc: limit frequency
commit 431e2bcc371016824f419baa745f82388258f3ee upstream.
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 <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ben Greear <greearb@candelatech.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
@@ -708,7 +708,7 @@ int rtc_irq_set_freq(struct rtc_device *rtc, struct rtc_task *task, int freq) | ||
708 | 708 | int err = 0; |
709 | 709 | unsigned long flags; |
710 | 710 | |
711 | - if (freq <= 0) | |
711 | + if (freq <= 0 || freq > 5000) | |
712 | 712 | return -EINVAL; |
713 | 713 | retry: |
714 | 714 | spin_lock_irqsave(&rtc->irq_task_lock, flags); |