android_kernel_samsung_msm8976/include
Thomas Gleixner 5a375bae39 posix-timers: Sanitize overrun handling
commit 78c9c4dfbf8c04883941445a195276bb4bb92c76 upstream.

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@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/20180626132705.018623573@linutronix.de
[bwh: Backported to 3.16: adjust filenames, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
2019-07-27 21:53:21 +02:00
..
acpi
asm-generic scsi: dma-mapping: always provide dma_get_cache_alignment 2019-07-27 21:46:11 +02:00
clocksource
crypto crypto: vmac - separate tfm and request context 2019-07-27 21:51:07 +02:00
drm
dt-bindings
keys
kvm
linux posix-timers: Sanitize overrun handling 2019-07-27 21:53:21 +02:00
math-emu
media media: v4l: event: Prevent freeing event subscriptions while accessed 2019-07-27 21:51:55 +02:00
memory
misc
net netfilter: ipv6: nf_defrag: reduce struct net memory waste 2019-07-27 21:52:53 +02:00
pcmcia
ras
rdma RDMA/core: Fix incorrect structure packing for booleans 2019-07-27 21:43:09 +02:00
rxrpc
scsi scsi: libsas: align sata_device's rps_resp on a cacheline 2019-07-27 21:46:11 +02:00
sdp
soc/qcom
sound ALSA: pcm: Return -EBUSY for OSS ioctls changing busy streams 2019-07-27 21:52:25 +02:00
target target: Avoid mappedlun symlink creation during lun shutdown 2019-07-27 21:44:16 +02:00
trace trace: cpufreq: fix typo in min/max cpufreq 2019-07-27 21:51:10 +02:00
uapi ppp: remove the PPPIOCDETACH ioctl 2019-07-27 21:52:16 +02:00
video
xen
Kbuild