Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit b02d82c6 authored by Phil Chang's avatar Phil Chang Committed by Vegard Nossum
Browse files

hrtimer: Prevent queuing of hrtimer without a function callback



[ Upstream commit 5a830bbce3af16833fe0092dec47b6dd30279825 ]

The hrtimer function callback must not be NULL. It has to be specified by
the call side but it is not validated by the hrtimer code. When a hrtimer
is queued without a function callback, the kernel crashes with a null
pointer dereference when trying to execute the callback in __run_hrtimer().

Introduce a validation before queuing the hrtimer in
hrtimer_start_range_ns().

[anna-maria: Rephrase commit message]

Signed-off-by: default avatarPhil Chang <phil.chang@mediatek.com>
Signed-off-by: default avatarAnna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarAnna-Maria Behnsen <anna-maria@linutronix.de>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
(cherry picked from commit ccef3adcb84816a30b8e535c8c4fcb167904e7b1)
[Vegard: fix conflicts in context due to missing commit
 138a6b7ae4dedde5513678f57b275eee19c41b6a ("hrtimer: Factor out
 __hrtimer_start_range_ns()").]
Signed-off-by: default avatarVegard Nossum <vegard.nossum@oracle.com>
parent 2e31c2b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment