linux/kernel/time
Thomas Gleixner f4781e76f9 alarmtimer: Prevent overflow of relative timers
Andrey reported a alartimer related RCU stall while fuzzing the kernel with
syzkaller.

The reason for this is an overflow in ktime_add() which brings the
resulting time into negative space and causes immediate expiry of the
timer. The following rearm with a small interval does not bring the timer
back into positive space due to the same issue.

This results in a permanent firing alarmtimer which hogs the CPU.

Use ktime_add_safe() instead which detects the overflow and clamps the
result to KTIME_SEC_MAX.

Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Kostya Serebryany <kcc@google.com>
Cc: syzkaller <syzkaller@googlegroups.com>
Cc: John Stultz <john.stultz@linaro.org>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: stable@vger.kernel.org
Link: http://lkml.kernel.org/r/20170530211655.802921648@linutronix.de
2017-06-04 15:21:18 +02:00
..
alarmtimer.c alarmtimer: Prevent overflow of relative timers 2017-06-04 15:21:18 +02:00
clockevents.c clockevents: Make clockevents_config() static 2017-03-23 12:14:05 -07:00
clocksource.c
hrtimer.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2017-05-02 19:09:35 -07:00
itimer.c sched/headers: Prepare to move cputime functionality from <linux/sched.h> into <linux/sched/cputime.h> 2017-03-02 08:42:39 +01:00
jiffies.c jiffies: Revert bogus conversion of NSEC_PER_SEC to TICK_NSEC 2017-03-07 11:03:28 +01:00
Kconfig
Makefile time: Remove CONFIG_TIMER_STATS 2017-02-10 11:15:08 +01:00
ntp_internal.h
ntp.c
posix-clock.c time: Change k_clock timer_set() and timer_get() to use timespec64 2017-04-14 21:49:56 +02:00
posix-cpu-timers.c posix-timers: Make signal printks conditional 2017-05-23 23:39:57 +02:00
posix-stubs.c time: Change k_clock nsleep() to use timespec64 2017-04-14 21:49:56 +02:00
posix-timers.c time: Change k_clock nsleep() to use timespec64 2017-04-14 21:49:56 +02:00
sched_clock.c timers, sched_clock: Update timeout for clock wrap 2017-03-23 12:30:27 -07:00
test_udelay.c
tick-broadcast-hrtimer.c
tick-broadcast.c Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-02-20 10:06:32 -08:00
tick-common.c
tick-internal.h
tick-oneshot.c
tick-sched.c cpufreq: schedutil: Avoid reducing frequency of busy CPUs prematurely 2017-03-23 02:12:14 +01:00
tick-sched.h Revert "nohz: Fix collision between tick and other hrtimers" 2017-02-16 12:19:18 -08:00
time.c time: delete current_fs_time() 2017-05-12 15:57:15 -07:00
timeconst.bc time: Introduce jiffies64_to_nsecs() 2017-02-01 09:13:45 +01:00
timeconv.c
timecounter.c
timekeeping_debug.c timekeeping: Use deferred printk() in debug code 2017-02-15 11:46:08 +01:00
timekeeping_internal.h
timekeeping.c timekeeping: Remove pointless conversion to bool 2017-03-31 10:26:56 +02:00
timekeeping.h
timer_list.c sysrq: Reset the watchdog timers while displaying high-resolution timers 2017-03-23 12:46:53 -07:00
timer.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2017-05-02 19:09:35 -07:00