]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
posix-timers: Make forward callback return s64
authorThomas Gleixner <tglx@linutronix.de>
Tue, 26 Jun 2018 13:21:31 +0000 (15:21 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:50:54 +0000 (19:50 -0600)
commitc2b368268fde708871a30af21279236736c1b7ff
treea74a0962aba6174b5fa318af83466194b2a70378
parent85707edb7c7c2dd18576bf95ff0f0c7b190b9cd7
posix-timers: Make forward callback return s64

BugLink: https://bugs.launchpad.net/bugs/1836287
[ Upstream commit 6fec64e1c92d5c715c6d0f50786daa7708266bde ]

The posix timer ti_overrun handling is broken because the forwarding
functions can return a huge number of overruns which does not fit in an
int. As a consequence timer_getoverrun(2) and siginfo::si_overrun can turn
into random number generators.

As a first step to address that let the timer_forward() callbacks return
the full 64 bit value.

Cast it to (int) temporarily until k_itimer::ti_overrun is converted to
64bit and the conversion to user space visible values is sanitized.

Reported-by: Team OWL337 <icytxw@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: John Stultz <john.stultz@linaro.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>
Link: https://lkml.kernel.org/r/20180626132704.922098090@linutronix.de
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
kernel/time/alarmtimer.c
kernel/time/posix-timers.c
kernel/time/posix-timers.h