diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-07-26 16:08:19 -0700 |
---|---|---|
committer | Jonas ABERG <jonas.aberg@stericsson.com> | 2011-10-28 11:05:37 +0200 |
commit | ccc81383adeda7251c8eb02740f0758fd0c5449a (patch) | |
tree | 9db89e406766cae3f1588ad7445e900e87e0c5b3 | |
parent | f5d3e752d38e5b95c6e0f09ba35c1429d74fce45 (diff) |
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>
Change-Id: I9c1217a3d2e04c0be8a12b028d0a921c708b91d9
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/35595
Tested-by: Per VAHLNE <per.xx.vahlne@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r-- | drivers/rtc/interface.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c index 0900dfea3ae..3195dbd3ec3 100644 --- a/drivers/rtc/interface.c +++ b/drivers/rtc/interface.c @@ -708,7 +708,7 @@ int rtc_irq_set_freq(struct rtc_device *rtc, struct rtc_task *task, int freq) int err = 0; unsigned long flags; - if (freq <= 0) + if (freq <= 0 || freq > 5000) return -EINVAL; retry: spin_lock_irqsave(&rtc->irq_task_lock, flags); |