CVE-2021-47467: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: kunit: fix reference count leak in kfree_at_end The reference counting issue happens in the normal path of kfree_at_end(). When kunit_alloc_and_get_resource() is invoked, the function forgets to handle the returned resource object, whose refcount increased inside, causing a refcount leak. Fix this issue by calling kunit_alloc_resource() instead of kunit_alloc_and_get_resource(). Fixed the following when applying: Shuah Khan <skhan@linuxfoundation.org> CHECK: Alignment should match open parenthesis + kunit_alloc_resource(test, NULL, kfree_res_free, GFP_KERNEL, (void *)to_free);
AI Analysis
Technical Summary
CVE-2021-47467 is a medium-severity vulnerability identified in the Linux kernel related to a reference count leak in the kernel unit testing framework (kunit), specifically in the function kfree_at_end(). The issue arises when the function kunit_alloc_and_get_resource() is called; it increases the reference count of a resource object but fails to properly handle it, leading to a reference count leak. This leak occurs in the normal execution path of kfree_at_end(), which is responsible for freeing resources at the end of a test. The root cause is that kunit_alloc_and_get_resource() increments the reference count internally but the returned resource object is not managed correctly, causing the reference count to remain elevated indefinitely. The fix involved replacing kunit_alloc_and_get_resource() with kunit_alloc_resource(), which properly manages the reference count by allocating the resource without prematurely incrementing it. This vulnerability does not affect confidentiality or integrity but impacts availability due to the potential for resource exhaustion over time if the leak accumulates. The CVSS v3.1 score is 5.3 (medium), reflecting that the attack vector is network-based (AV:N), requires no privileges (PR:N), and no user interaction (UI:N), but only impacts availability (A:L) without affecting confidentiality or integrity. No known exploits are currently reported in the wild. The vulnerability affects specific Linux kernel versions identified by commit hashes, and the fix was contributed by Shuah Khan from the Linux Foundation.
Potential Impact
For European organizations, the impact of CVE-2021-47467 is primarily related to system stability and availability. Since the vulnerability causes a reference count leak in kernel resource management, it can lead to gradual resource exhaustion, potentially resulting in degraded system performance or crashes if the leak accumulates over time. This can affect critical infrastructure, servers, and embedded systems running vulnerable Linux kernel versions. Although the vulnerability does not allow for privilege escalation, data leakage, or integrity compromise, the availability impact could disrupt services, especially in environments with long uptime requirements or high reliability demands such as telecommunications, cloud providers, and industrial control systems. Organizations relying on Linux-based systems for critical operations should be aware of this vulnerability to prevent unexpected downtime or service interruptions. However, the absence of known exploits and the medium severity rating suggest that the immediate risk is moderate but should not be ignored in sensitive or high-availability contexts.
Mitigation Recommendations
To mitigate CVE-2021-47467, European organizations should: 1) Apply the official Linux kernel patches that replace kunit_alloc_and_get_resource() with kunit_alloc_resource() as soon as they are available for their specific kernel versions. 2) Regularly update and maintain Linux kernel versions to incorporate security fixes, especially in production environments. 3) Monitor system logs and resource usage metrics to detect abnormal increases in resource consumption that could indicate a leak. 4) Employ kernel live patching solutions where feasible to reduce downtime associated with kernel upgrades. 5) For embedded or specialized Linux systems where kernel upgrades are challenging, consider isolating vulnerable components or limiting exposure to untrusted inputs to reduce the attack surface. 6) Conduct thorough testing after patch application to ensure system stability and that the fix does not introduce regressions. These steps go beyond generic advice by emphasizing proactive monitoring, live patching, and careful testing tailored to Linux kernel maintenance practices.
Affected Countries
Germany, France, United Kingdom, Netherlands, Italy, Spain, Poland, Sweden, Finland, Belgium
CVE-2021-47467: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: kunit: fix reference count leak in kfree_at_end The reference counting issue happens in the normal path of kfree_at_end(). When kunit_alloc_and_get_resource() is invoked, the function forgets to handle the returned resource object, whose refcount increased inside, causing a refcount leak. Fix this issue by calling kunit_alloc_resource() instead of kunit_alloc_and_get_resource(). Fixed the following when applying: Shuah Khan <skhan@linuxfoundation.org> CHECK: Alignment should match open parenthesis + kunit_alloc_resource(test, NULL, kfree_res_free, GFP_KERNEL, (void *)to_free);
AI-Powered Analysis
Technical Analysis
CVE-2021-47467 is a medium-severity vulnerability identified in the Linux kernel related to a reference count leak in the kernel unit testing framework (kunit), specifically in the function kfree_at_end(). The issue arises when the function kunit_alloc_and_get_resource() is called; it increases the reference count of a resource object but fails to properly handle it, leading to a reference count leak. This leak occurs in the normal execution path of kfree_at_end(), which is responsible for freeing resources at the end of a test. The root cause is that kunit_alloc_and_get_resource() increments the reference count internally but the returned resource object is not managed correctly, causing the reference count to remain elevated indefinitely. The fix involved replacing kunit_alloc_and_get_resource() with kunit_alloc_resource(), which properly manages the reference count by allocating the resource without prematurely incrementing it. This vulnerability does not affect confidentiality or integrity but impacts availability due to the potential for resource exhaustion over time if the leak accumulates. The CVSS v3.1 score is 5.3 (medium), reflecting that the attack vector is network-based (AV:N), requires no privileges (PR:N), and no user interaction (UI:N), but only impacts availability (A:L) without affecting confidentiality or integrity. No known exploits are currently reported in the wild. The vulnerability affects specific Linux kernel versions identified by commit hashes, and the fix was contributed by Shuah Khan from the Linux Foundation.
Potential Impact
For European organizations, the impact of CVE-2021-47467 is primarily related to system stability and availability. Since the vulnerability causes a reference count leak in kernel resource management, it can lead to gradual resource exhaustion, potentially resulting in degraded system performance or crashes if the leak accumulates over time. This can affect critical infrastructure, servers, and embedded systems running vulnerable Linux kernel versions. Although the vulnerability does not allow for privilege escalation, data leakage, or integrity compromise, the availability impact could disrupt services, especially in environments with long uptime requirements or high reliability demands such as telecommunications, cloud providers, and industrial control systems. Organizations relying on Linux-based systems for critical operations should be aware of this vulnerability to prevent unexpected downtime or service interruptions. However, the absence of known exploits and the medium severity rating suggest that the immediate risk is moderate but should not be ignored in sensitive or high-availability contexts.
Mitigation Recommendations
To mitigate CVE-2021-47467, European organizations should: 1) Apply the official Linux kernel patches that replace kunit_alloc_and_get_resource() with kunit_alloc_resource() as soon as they are available for their specific kernel versions. 2) Regularly update and maintain Linux kernel versions to incorporate security fixes, especially in production environments. 3) Monitor system logs and resource usage metrics to detect abnormal increases in resource consumption that could indicate a leak. 4) Employ kernel live patching solutions where feasible to reduce downtime associated with kernel upgrades. 5) For embedded or specialized Linux systems where kernel upgrades are challenging, consider isolating vulnerable components or limiting exposure to untrusted inputs to reduce the attack surface. 6) Conduct thorough testing after patch application to ensure system stability and that the fix does not introduce regressions. These steps go beyond generic advice by emphasizing proactive monitoring, live patching, and careful testing tailored to Linux kernel maintenance practices.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- Linux
- Date Reserved
- 2024-05-22T06:20:56.198Z
- Cisa Enriched
- true
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 682d9833c4522896dcbe9214
Added to database: 5/21/2025, 9:09:07 AM
Last enriched: 6/30/2025, 1:26:51 PM
Last updated: 10/16/2025, 12:56:46 AM
Views: 23
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-11683: CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer in TODDR YAML::Syck
MediumCVE-2025-11619: CWE-295 Improper Certificate Validation in Devolutions Devolutions Server
HighCVE-2025-43313: An app may be able to access sensitive user data in Apple macOS
MediumCVE-2025-43282: An app may be able to cause unexpected system termination in Apple iPadOS
MediumCVE-2025-43281: A local attacker may be able to elevate their privileges in Apple macOS
UnknownActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.