|
@@ -660,6 +660,14 @@ static int alarm_timer_set(struct k_itimer *timr, int flags,
|
|
|
|
|
|
/* start the timer */
|
|
/* start the timer */
|
|
timr->it.alarm.interval = timespec64_to_ktime(new_setting->it_interval);
|
|
timr->it.alarm.interval = timespec64_to_ktime(new_setting->it_interval);
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Rate limit to the tick as a hot fix to prevent DOS. Will be
|
|
|
|
+ * mopped up later.
|
|
|
|
+ */
|
|
|
|
+ if (timr->it.alarm.interval < TICK_NSEC)
|
|
|
|
+ timr->it.alarm.interval = TICK_NSEC;
|
|
|
|
+
|
|
exp = timespec64_to_ktime(new_setting->it_value);
|
|
exp = timespec64_to_ktime(new_setting->it_value);
|
|
/* Convert (if necessary) to absolute time */
|
|
/* Convert (if necessary) to absolute time */
|
|
if (flags != TIMER_ABSTIME) {
|
|
if (flags != TIMER_ABSTIME) {
|