Vulnerability in Kernel: ftrace Hash Direct_Functions Cleanup
Summary
GSD-2022-1003308: ftrace: Clean up hash direct_functions on register failures. Affects Kernel versions >= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, < cae2978d6907ef2c08b9b15f704e783f7c284713. 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 Kernel is a crucial component of the Linux operating system, responsible for managing system resources and facilitating communication between hardware and software. It provides essential functionalities such as process management, memory management, and device drivers. The ftrace subsystem within the Kernel enables dynamic tracing of function calls, allowing developers to investigate and analyze system behavior. However, a vulnerability has been identified in the ftrace subsystem that requires attention.
Vulnerability Detail
The ftrace vulnerability, identified as GSD-2022-1003308, involves the improper cleanup of hash direct_functions on register failures. When registering a direct function with ftrace, if the registration fails, the hash table used to store direct functions is not properly cleaned up. This can lead to memory leaks and potential exploitation by malicious actors. The impact and attack plausibility of this vulnerability have not been proven yet, but it is essential to address it to ensure the security and stability of the Kernel.
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, developers can manually clean up the hash direct_functions in case of registration failures. The following code snippet demonstrates the cleanup process:
if (register_direct_function() < 0) {
cleanup_direct_functions();
}
By explicitly calling the cleanup_direct_functions() function after a failed registration, developers can ensure the proper cleanup of the hash table.
Conclusion
The ftrace vulnerability in the Kernel, identified as GSD-2022-1003308, involves the improper cleanup of hash direct_functions on register failures. To mitigate this vulnerability, it is crucial to update the Linux Kernel to version v5.15.46 or later. Additionally, developers can utilize the provided workaround to manually clean up the hash table in case of registration failures. For further support and assistance in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The Kernel is a fundamental component of the Linux operating system, responsible for managing system resources and facilitating communication between hardware and software.
The ftrace subsystem is a feature within the Kernel that enables dynamic tracing of function calls, allowing developers to investigate and analyze system behavior.
The impact of this vulnerability is currently unknown, as the actual attack plausibility has not been proven. However, it is crucial to address it to prevent potential memory leaks and exploitation.
To fix this vulnerability, it is recommended to update the Linux Kernel to version v5.15.46 or later, which includes the necessary fix for the ftrace cleanup issue.
Yes, developers can manually clean up the hash direct_functions by calling the cleanup_direct_functions() function after a failed registration.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.