summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorGreg Hackmann <ghackmann@google.com>2017-07-24 10:19:24 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-07-27 15:03:29 -0700
commit711b413375f15ee025a5e48fce466c31ef46dacc (patch)
treecd0402a5d7b5a89769b555388d36044b20315a5d /kernel
parentd40d512105e3f16c2cb3bf3ba8533681650cfeb2 (diff)
downloadlinux-stable-711b413375f15ee025a5e48fce466c31ef46dacc.tar.gz
linux-stable-711b413375f15ee025a5e48fce466c31ef46dacc.tar.bz2
linux-stable-711b413375f15ee025a5e48fce466c31ef46dacc.zip
alarmtimer: don't rate limit one-shot timers
Commit ff86bf0c65f1 ("alarmtimer: Rate limit periodic intervals") sets a minimum bound on the alarm timer interval. This minimum bound shouldn't be applied if the interval is 0. Otherwise, one-shot timers will be converted into periodic ones. Fixes: ff86bf0c65f1 ("alarmtimer: Rate limit periodic intervals") Reported-by: Ben Fennema <fennema@google.com> Signed-off-by: Greg Hackmann <ghackmann@google.com> Cc: stable@vger.kernel.org Cc: John Stultz <john.stultz@linaro.org> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/time/alarmtimer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c
index 3d7fb75354b7..119847b93ba6 100644
--- a/kernel/time/alarmtimer.c
+++ b/kernel/time/alarmtimer.c
@@ -619,7 +619,8 @@ static int alarm_timer_set(struct k_itimer *timr, int flags,
* Rate limit to the tick as a hot fix to prevent DOS. Will be
* mopped up later.
*/
- if (ktime_to_ns(timr->it.alarm.interval) < TICK_NSEC)
+ if (timr->it.alarm.interval.tv64 &&
+ ktime_to_ns(timr->it.alarm.interval) < TICK_NSEC)
timr->it.alarm.interval = ktime_set(0, TICK_NSEC);
exp = timespec_to_ktime(new_setting->it_value);