diff options
author | Thomas Gleixner <[email protected]> | 2018-06-26 15:21:32 +0200 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2018-07-02 11:33:25 +0200 |
commit | 78c9c4dfbf8c04883941445a195276bb4bb92c76 (patch) | |
tree | ca626839d808acf6f664cc27a322c418bb68d31e /net/lapb/lapb_subr.c | |
parent | 6fec64e1c92d5c715c6d0f50786daa7708266bde (diff) |
posix-timers: Sanitize overrun handling
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 <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Acked-by: John Stultz <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Michael Kerrisk <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions