Potential overflow in timeout_to_jiffies() in drm/msm package
Summary
GSD-2021-1002148: drm/msm: Avoid potential overflow in timeout_to_jiffies(). Affects Kernel versions >= 6cedb8b377bba6520508399b74754b9a0ca06edf, < 171316a68d9a8e0d9e28b7cf4c15afc4c6244a4e. 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 drm/msm package is a component of the Linux Kernel that provides support for graphics and display drivers for Qualcomm Adreno GPUs. It is responsible for managing the display subsystem and enabling graphics rendering on devices that utilize Qualcomm chipsets. The timeout_to_jiffies() function is used to convert a timeout value in milliseconds to the corresponding jiffies value, which represents the number of timer ticks in the kernel. This conversion is crucial for handling timeouts in various operations within the package.
Vulnerability Detail
The vulnerability in drm/msm arises from a potential overflow in the timeout_to_jiffies() function. If a large timeout value is provided, the conversion process may result in an overflow, leading to incorrect timeout calculations. This could potentially cause unexpected behavior or even system crashes. The vulnerability was introduced in version v5.6 of the Linux Kernel and has been fixed in version v5.15.
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
As a workaround, users can manually modify the timeout values to ensure they do not exceed the maximum limit that could trigger an overflow. This can be done by carefully reviewing the code that utilizes the timeout_to_jiffies() function and adjusting the timeout values accordingly. Here is an example of how to modify a timeout value in C code:
#include <linux/jiffies.h>
unsigned long modified_timeout = timeout_to_jiffies(MAX_TIMEOUT);
Conclusion
In conclusion, the potential overflow in timeout_to_jiffies() in the drm/msm package of the Linux Kernel can lead to incorrect timeout calculations and unexpected behavior. It is crucial to update to the fixed version (v5.15 or later) to mitigate any potential risks. Users can also utilize tools like Vulert to check if their systems are affected by this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The potential overflow in timeout_to_jiffies() can lead to incorrect timeout calculations, resulting in unexpected behavior or system crashes. It is important to update to the fixed version to mitigate any potential risks.
You can use tools like Vulert (https://vulert.com) to check if your system is affected by this vulnerability. Vulert uses a manifest file like package-lock.json to monitor and alert in real-time for open-source vulnerabilities in the software.
Yes, a workaround is available. Users can manually modify the timeout values to avoid triggering an overflow. However, it is recommended to update to the fixed version as soon as possible.
This vulnerability was introduced in version v5.6 of the Linux Kernel. All versions between v5.6 and v5.14 are affected. The issue has been fixed in version v5.15.
More information about the fix for this vulnerability can be found in commit 171316a68d9a8e0d9e28b7cf4c15afc4c6244a4e of the Linux Kernel repository. You can access the repository at https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.