]> git.ipfire.org Git - people/arne_f/kernel.git/commit
hrtimer: Catch invalid clockids again
authorMarc Zyngier <marc.zyngier@arm.com>
Fri, 15 Jan 2016 17:41:09 +0000 (17:41 +0000)
committerThomas Gleixner <tglx@linutronix.de>
Sat, 18 Feb 2017 09:58:39 +0000 (10:58 +0100)
commit336a9cde10d641e70bac67d90ae91b3190c3edca
tree6b987abecbe65d4ed1dcd3a9d5ad4e2215b4bac8
parentdba9a0babdd938a51d11ae81f9c40d07ca613f43
hrtimer: Catch invalid clockids again

commit 82e88ff1ea94 ("hrtimer: Revert CLOCK_MONOTONIC_RAW support") removed
unfortunately a sanity check in the hrtimer code which was part of that
MONOTONIC_RAW patch series.

It would have caught the bogus usage of CLOCK_MONOTONIC_RAW in the wireless
code. So bring it back.

It is way too easy to take any random clockid and feed it to the hrtimer
subsystem. At best, it gets mapped to a monotonic base, but it would be
better to just catch illegal values as early as possible.

Detect invalid clockids, map them to CLOCK_MONOTONIC and emit a warning.

[ tglx: Replaced the BUG by a WARN and gracefully map to CLOCK_MONOTONIC ]

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Tomasz Nowicki <tn@semihalf.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Link: http://lkml.kernel.org/r/1452879670-16133-3-git-send-email-marc.zyngier@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/time/hrtimer.c