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: 8/1/2025, 7:41:51 AM
Views: 13
Related Threats
CVE-2025-8878: CWE-94 Improper Control of Generation of Code ('Code Injection') in properfraction Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress
MediumCVE-2025-8143: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in pencidesign Soledad
MediumCVE-2025-8142: CWE-98 Improper Control of Filename for Include/Require Statement in PHP Program ('PHP Remote File Inclusion') in pencidesign Soledad
HighCVE-2025-8105: CWE-94 Improper Control of Generation of Code ('Code Injection') in pencidesign Soledad
HighCVE-2025-8719: CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in reubenthiessen Translate This gTranslate Shortcode
MediumActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
External Links
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.