diff options
Diffstat (limited to 'kernel/time/alarmtimer.c')
-rw-r--r-- | kernel/time/alarmtimer.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 2b2e032b4eb4..ee2f4202d82a 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c | |||
@@ -660,6 +660,14 @@ static int alarm_timer_set(struct k_itimer *timr, int flags, | |||
660 | 660 | ||
661 | /* start the timer */ | 661 | /* start the timer */ |
662 | timr->it.alarm.interval = timespec64_to_ktime(new_setting->it_interval); | 662 | timr->it.alarm.interval = timespec64_to_ktime(new_setting->it_interval); |
663 | |||
664 | /* | ||
665 | * Rate limit to the tick as a hot fix to prevent DOS. Will be | ||
666 | * mopped up later. | ||
667 | */ | ||
668 | if (timr->it.alarm.interval < TICK_NSEC) | ||
669 | timr->it.alarm.interval = TICK_NSEC; | ||
670 | |||
663 | exp = timespec64_to_ktime(new_setting->it_value); | 671 | exp = timespec64_to_ktime(new_setting->it_value); |
664 | /* Convert (if necessary) to absolute time */ | 672 | /* Convert (if necessary) to absolute time */ |
665 | if (flags != TIMER_ABSTIME) { | 673 | if (flags != TIMER_ABSTIME) { |