Use-after-free vulnerability in watchdog package
Summary
GSD-2021-1001414: watchdog: Fix possible use-after-free by calling del_timer_sync(). Affects Kernel versions < 8bec568d7518b1504a602ed5376bb322e4dbb270. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The watchdog package is a component of the Linux Kernel that provides a mechanism for monitoring the system's health and ensuring its proper functioning. It includes a timer-based watchdog device that periodically checks if the system is responsive. This vulnerability in the watchdog package allows for a use-after-free scenario, where a timer is accessed after it has been freed from memory. This can lead to various issues, including crashes, memory corruption, and potential privilege escalation.
Vulnerability Detail
The use-after-free vulnerability in the watchdog package arises from a failure to properly handle the deletion of timers. When a timer is deleted, it should be ensured that no further references to it exist. However, in this case, the 'del_timer_sync()' function is not called, leading to a potential use-after-free scenario. An attacker who can trigger this vulnerability may be able to exploit it to execute arbitrary code, escalate privileges, or cause a denial-of-service condition. The impact and attack plausibility of this vulnerability have not been proven yet.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
If updating the kernel is not immediately feasible, a possible workaround is to manually modify the code to include the 'del_timer_sync()' function call at the appropriate location. Here is an example of how the code can be modified:
// Original code
...
// Delete the timer
kfree(timer);
...
// Modified code
...
// Delete the timer
if (timer) {
del_timer_sync(timer);
kfree(timer);
}
...
Conclusion
The use-after-free vulnerability in the watchdog package can have serious security implications. It is crucial to update the Linux Kernel to the recommended version or apply the provided workaround to mitigate the risk. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The watchdog package is a component of the Linux Kernel that provides a mechanism for monitoring the system's health and ensuring its proper functioning.
A use-after-free vulnerability occurs when a program continues to use a memory reference after it has been freed. This can lead to various issues, including crashes, memory corruption, and potential privilege escalation.
The impact of this vulnerability can vary depending on the specific exploitation scenario. It could potentially allow an attacker to execute arbitrary code, escalate privileges, or cause a denial-of-service condition.
To fix this vulnerability, it is recommended to update the Linux Kernel to version v4.14.240 or later. This fix ensures that the 'del_timer_sync()' function is called properly, preventing the use-after-free scenario.
If updating the kernel is not immediately feasible, a possible workaround is to manually modify the code to include the 'del_timer_sync()' function call at the appropriate location. Refer to the provided code example for more details.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.