NULL Pointer Check Missing in lkdtm/bugs Package
Summary
GSD-2022-1002661: lkdtm/bugs: Check for the NULL pointer after calling kmalloc. Affects Kernel versions >= ae2e1aad3e48e495878d9f149e437a308bfdaefa, < ce12f7f6b19596edd6b250716930a4ce38bd1f96. 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 lkdtm/bugs package is a component of the Linux Kernel ecosystem. It provides a set of kernel self-tests for various bug scenarios. These tests are designed to validate the behavior of the kernel in the presence of specific bugs. The package is widely used by developers and testers to identify and fix issues in the Linux Kernel.
Vulnerability Detail
The vulnerability identified in the lkdtm/bugs package is the absence of a NULL pointer check after calling kmalloc. This vulnerability was introduced in version v5.7 of the Linux Kernel by commit ae2e1aad3e48e495878d9f149e437a308bfdaefa and was fixed in version v5.18.4 by commit ce12f7f6b19596edd6b250716930a4ce38bd1f96. The lack of a NULL pointer check can lead to a potential NULL pointer dereference, causing a system crash or allowing an attacker to execute arbitrary code. The impact and attack plausibility of this vulnerability have not been proven yet.
How To Fix
No fixed version is published for this vulnerability.
To fix this vulnerability, it is recommended to update the Linux Kernel to version v5.18.4 or later. This can be done by pulling the latest code from the official Linux Kernel repository (https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/) and compiling and installing the updated kernel. Alternatively, users can wait for their Linux distribution to release an updated package containing the fix.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, developers can manually add a NULL pointer check after calling kmalloc in the affected code. Here is an example of how the check can be implemented:
void *ptr = kmalloc(size, GFP_KERNEL);
if (!ptr) {
// Handle allocation failure
}
Conclusion
In conclusion, the lkdtm/bugs package in the Linux Kernel is vulnerable to a NULL pointer dereference due to the absence of a NULL pointer check after calling kmalloc. This vulnerability can lead to system crashes or potential execution of arbitrary code. It is recommended to update the Linux Kernel to version v5.18.4 or later to fix this vulnerability. Alternatively, developers can apply a temporary workaround by manually adding a NULL pointer check in the affected code. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The impact of this vulnerability can range from a system crash due to a NULL pointer dereference to potential execution of arbitrary code by an attacker.
You can use the Vulert Playground (https://vulert.com/scanner) to check if your system is affected by this vulnerability. Simply upload your package-lock.json file and the playground will analyze it for any open-source vulnerabilities, including this one.
At the time of this report, there is no known exploit for this vulnerability. However, it is important to apply the fix as soon as possible to mitigate any potential risks.
While updating the kernel is the recommended solution, you can apply a temporary workaround by manually adding a NULL pointer check after calling kmalloc in the affected code. Please refer to the 'workaround' section for more details.
You can find more information about this vulnerability, including the commit details and source code changes, in the vulnerability database maintained by the Cloud Security Alliance. Here is the link to the specific vulnerability: https://github.com/cloudsecurityalliance/gsd-database/blob/main/2022/1002xxx/GSD-2022-1002661.json
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.
Follow Vulert in Google
Get more Vulert vulnerability and dependency-security updates in Google Search and AI results.