alistair23-linux/kernel/time
Thomas Gleixner bd03143007 alarmtimer: Init nanosleep alarm timer on stack
syszbot reported the following debugobjects splat:

 ODEBUG: object is on stack, but not annotated
 WARNING: CPU: 0 PID: 4185 at lib/debugobjects.c:328

 RIP: 0010:debug_object_is_on_stack lib/debugobjects.c:327 [inline]
 debug_object_init+0x17/0x20 lib/debugobjects.c:391
 debug_hrtimer_init kernel/time/hrtimer.c:410 [inline]
 debug_init kernel/time/hrtimer.c:458 [inline]
 hrtimer_init+0x8c/0x410 kernel/time/hrtimer.c:1259
 alarm_init kernel/time/alarmtimer.c:339 [inline]
 alarm_timer_nsleep+0x164/0x4d0 kernel/time/alarmtimer.c:787
 SYSC_clock_nanosleep kernel/time/posix-timers.c:1226 [inline]
 SyS_clock_nanosleep+0x235/0x330 kernel/time/posix-timers.c:1204
 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x42/0xb7

This happens because the hrtimer for the alarm nanosleep is on stack, but
the code does not use the proper debug objects initialization.

Split out the code for the allocated use cases and invoke
hrtimer_init_on_stack() for the nanosleep related functions.

Reported-by: syzbot+a3e0726462b2e346a31d@syzkaller.appspotmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: John Stultz <john.stultz@linaro.org>
Cc: syzkaller-bugs@googlegroups.com
Link: https://lkml.kernel.org/r/alpine.DEB.2.21.1803261528270.1585@nanos.tec.linutronix.de
2018-03-29 16:10:07 +02:00
..
alarmtimer.c alarmtimer: Init nanosleep alarm timer on stack 2018-03-29 16:10:07 +02:00
clockevents.c clockevents: Retry programming min delta up to 10 times 2017-10-19 16:29:15 +02:00
clocksource.c clocksource: Use ATTRIBUTE_GROUPS 2018-02-28 14:05:07 +01:00
hrtimer.c hrtimer: Unify MONOTONIC and BOOTTIME clock behavior 2018-03-13 07:34:23 +01:00
itimer.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
jiffies.c
Kconfig sched/isolation: Make CONFIG_NO_HZ_FULL select CONFIG_CPU_ISOLATION 2017-12-18 13:46:42 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ntp.c Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-11-13 17:56:58 -08:00
ntp_internal.h Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2017-11-13 17:56:58 -08:00
posix-clock.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
posix-cpu-timers.c Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2018-01-30 11:55:56 -08:00
posix-stubs.c timekeeping: Add the new CLOCK_MONOTONIC_ACTIVE clock 2018-03-13 07:34:21 +01:00
posix-timers.c posix-timers: Unify MONOTONIC and BOOTTIME clock behavior 2018-03-13 07:34:22 +01:00
posix-timers.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
sched_clock.c
test_udelay.c
tick-broadcast-hrtimer.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tick-broadcast.c
tick-common.c timekeeping: Make the MONOTONIC clock behave like the BOOTTIME clock 2018-03-13 07:34:22 +01:00
tick-internal.h timekeeping: Make the MONOTONIC clock behave like the BOOTTIME clock 2018-03-13 07:34:22 +01:00
tick-oneshot.c clockevents: Update clockevents device next_event on stop 2017-11-01 18:20:17 +01:00
tick-sched.c timekeeping: Make the MONOTONIC clock behave like the BOOTTIME clock 2018-03-13 07:34:22 +01:00
tick-sched.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
time.c y2038: Introduce struct __kernel_old_timeval 2018-03-19 15:23:03 +01:00
timeconst.bc
timeconv.c
timecounter.c
timekeeping.c hrtimer: Unify MONOTONIC and BOOTTIME clock behavior 2018-03-13 07:34:23 +01:00
timekeeping.h hrtimer: Unify MONOTONIC and BOOTTIME clock behavior 2018-03-13 07:34:23 +01:00
timekeeping_debug.c PM / timekeeping: Print debug messages when requested 2017-07-23 00:03:43 +02:00
timekeeping_internal.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
timer.c hrtimer: Unify remote enqueue handling 2018-01-16 02:53:58 +01:00
timer_list.c timer/debug: Change /proc/timer_list from 0444 to 0400 2017-11-13 16:04:06 +01:00