CVE-2025-68214: timers: Fix NULL function pointer race in timer_shutdown_sync()
In the Linux kernel, the following vulnerability has been resolved:
timers: Fix NULL function pointer race in timershutdownsync()
There is a race condition between timershutdownsync() and timer expiration that can lead to hitting a WARNON in expiretimers().
The issue occurs when timershutdownsync() clears the timer function to NULL while the timer is still running on another CPU. The race scenario looks like this:
CPU0 CPU1 <SOFTIRQ> locktimerbase() expiretimers() base->runningtimer = timer; unlocktimerbase() [calltimerfn enter] modtimer() ... timershutdownsync() locktimerbase() // For now, will not detach the timer but only clear its function to NULL if (base->runningtimer != timer) ret = detachifpending(timer, base, true); if (shutdown) timer->function = NULL; unlocktimerbase() [calltimerfn exit] locktimerbase() base->runningtimer = NULL; unlocktimerbase() ... // Now timer is pending while its function set to NULL. // next timer trigger <SOFTIRQ> expiretimers() WARNONONCE(!fn) // hit ... locktimerbase() // Now timer will detach if (base->runningtimer != timer) ret = detachifpending(timer, base, true); if (shutdown) timer->function = NULL; unlocktimerbase()
The problem is that timershutdownsync() clears the timer function regardless of whether the timer is currently running. This can leave a pending timer with a NULL function pointer, which triggers the WARNONONCE(!fn) check in expiretimers().
Fix this by only clearing the timer function when actually detaching the timer. If the timer is running, leave the function pointer intact, which is safe because the timer will be properly detached when it finishes running.
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-68214?
CVE-2025-68214 has been classified as a medium severity vulnerability due to its potential impact on system stability.
How do I fix CVE-2025-68214?
To address CVE-2025-68214, it is recommended to update your Linux kernel to the latest version where this issue has been patched.
What type of vulnerability is CVE-2025-68214?
CVE-2025-68214 is a race condition vulnerability affecting the timer functions in the Linux kernel.
Which software versions are affected by CVE-2025-68214?
CVE-2025-68214 affects various versions of the Linux kernel where the timer_shutdown_sync() function is utilized.
What are the potential impacts of CVE-2025-68214?
The potential impacts of CVE-2025-68214 include system instability, which may result in unexpected warnings during timer expiration.