ACK: [SRU][Xenial][PATCH v2 1/1] posix-timers: Sanitize overrun handling

Tyler Hicks tyhicks at canonical.com
Fri Nov 30 15:05:54 UTC 2018


On 2018-11-29 01:42:41, Khalid Elmously wrote:
> From: Thomas Gleixner <tglx at linutronix.de>
> 
> The posix timer 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.
> 
> The k_clock::timer_forward() callbacks return a 64 bit value now. Make
> k_itimer::ti_overrun[_last] 64bit as well, so the kernel internal
> accounting is correct. 3Remove the temporary (int) casts.
> 
> Add a helper function which clamps the overrun value returned to user space
> via timer_getoverrun(2) or siginfo::si_overrun limited to a positive value
> between 0 and INT_MAX. INT_MAX is an indicator for user space that the
> overrun value has been clamped.
> 
> Reported-by: Team OWL337 <icytxw at gmail.com>
> Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
> Acked-by: John Stultz <john.stultz at linaro.org>
> Cc: Peter Zijlstra <peterz at infradead.org>
> Cc: Michael Kerrisk <mtk.manpages at gmail.com>
> Link: https://lkml.kernel.org/r/20180626132705.018623573@linutronix.de
> (backported from commit 78c9c4dfbf8c04883941445a195276bb4bb92c76)
> [kmously: Mostly context adjustments or adjusting for slightly refactored
> code. A cosmetic change from the original (changing '-1' to
> '-1LL') was dropped because it's not applicable ]
> Signed-off-by: Khalid Elmously <khalid.elmously at canonical.com>

Acked-by: Tyler Hicks <tyhicks at canonical.com>

Thanks!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20181130/c86242aa/attachment.sig>


More information about the kernel-team mailing list