diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2024-03-25 08:40:11 +0200 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2024-04-08 15:03:07 +0200 |
commit | 456e3788bc7164c1c8298045e04068b8e3d8e413 (patch) | |
tree | 09efbe2666a269c3da3a88e9dba4ff3498b30a23 /kernel/time/timekeeping.c | |
parent | d2e58ab5cda2a225c406ac10d0a8b960bc5a39b6 (diff) |
vdso: Make delta calculation overflow safe
Kernel timekeeping is designed to keep the change in cycles (since the last
timer interrupt) below max_cycles, which prevents multiplication overflow
when converting cycles to nanoseconds. However, if timer interrupts stop,
the calculation will eventually overflow.
Add protection against that, enabled by config option
CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT. Check against max_cycles, falling
back to a slower higher precision calculation.
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20240325064023.2997-8-adrian.hunter@intel.com
Diffstat (limited to 'kernel/time/timekeeping.c')
0 files changed, 0 insertions, 0 deletions