]> git.baikalelectronics.ru Git - kernel.git/commit
posix-cpu-timers: Always clear head pointer on dequeue
authorThomas Gleixner <tglx@linutronix.de>
Thu, 5 Sep 2019 12:03:40 +0000 (14:03 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 5 Sep 2019 19:16:22 +0000 (21:16 +0200)
commitb67b3c3eee336cbac7f67b3eb5bacff662287401
tree3a1caca964a55a653ffc2175c625e0e275750f2d
parentc7fb503fe3e8ad232b8f864ff32eff6ce4d81c52
posix-cpu-timers: Always clear head pointer on dequeue

The head pointer in struct cpu_timer is checked to be NULL in
posix_cpu_timer_del() when the delete raced with the exit cleanup. The
works correctly as long as the timer is actually dequeued via
posix_cpu_timers_exit*().

But if the timer was dequeued due to expiry the head pointer is still set
and triggers the warning.

In fact keeping the head pointer around after any dequeue is pointless as
is has no meaning at all after that.

Clear the head pointer always on dequeue and remove the unused requeue
function while at it.

Fixes: 61c966701c1a ("posix-cpu-timers: Utilize timerqueue for storage")
Reported-by: syzbot+55acd54b57bb4b3840a4@syzkaller.appspotmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/20190905120539.707986830@linutronix.de
include/linux/posix-timers.h