CVE-2021-47365: Vulnerability in Linux Linux
In the Linux kernel, the following vulnerability has been resolved: afs: Fix page leak There's a loop in afs_extend_writeback() that adds extra pages to a write we want to make to improve the efficiency of the writeback by making it larger. This loop stops, however, if we hit a page we can't write back from immediately, but it doesn't get rid of the page ref we speculatively acquired. This was caused by the removal of the cleanup loop when the code switched from using find_get_pages_contig() to xarray scanning as the latter only gets a single page at a time, not a batch. Fix this by putting the page on a ref on an early break from the loop. Unfortunately, we can't just add that page to the pagevec we're employing as we'll go through that and add those pages to the RPC call. This was found by the generic/074 test. It leaks ~4GiB of RAM each time it is run - which can be observed with "top".
AI Analysis
Technical Summary
CVE-2021-47365 is a vulnerability identified in the Linux kernel's AFS (Andrew File System) implementation, specifically within the afs_extend_writeback() function. The vulnerability arises from a page reference leak caused by a logic error in the handling of pages during writeback operations. The function attempts to optimize writeback efficiency by extending the batch of pages to write; however, when it encounters a page that cannot be immediately written back, the loop breaks early but fails to properly release the speculative reference to that page. This results in a page reference leak, which over time causes significant memory consumption, as evidenced by the generic/074 test that leaks approximately 4 GiB of RAM per run. The root cause is linked to a code refactor where the cleanup loop was removed when switching from find_get_pages_contig(), which retrieved pages in batches, to xarray scanning, which retrieves pages one at a time. The fix involves ensuring that the page reference is properly accounted for on early loop exit without adding the page to the pagevec used for RPC calls, preventing the leak. While this vulnerability does not directly enable code execution or privilege escalation, the memory leak can degrade system performance and potentially lead to denial of service (DoS) conditions due to resource exhaustion. No known exploits are currently reported in the wild, and the vulnerability affects specific Linux kernel versions identified by commit hashes. The issue is primarily relevant to systems running the affected Linux kernel versions with AFS enabled and actively used.
Potential Impact
For European organizations, the impact of CVE-2021-47365 depends largely on their use of Linux systems with AFS enabled. Organizations relying on Linux servers for critical infrastructure, file sharing, or networked storage that utilize AFS could experience significant memory leaks leading to degraded system performance or crashes. This could disrupt business operations, especially in sectors such as telecommunications, research institutions, and enterprises with legacy AFS deployments. The memory leak could cause denial of service conditions, forcing unplanned downtime or requiring system reboots, impacting availability and operational continuity. While the vulnerability does not directly compromise confidentiality or integrity, the availability impact can be severe in environments with high workloads or limited memory resources. European organizations with large-scale Linux deployments or those in industries with stringent uptime requirements should be particularly cautious. Additionally, the leak could complicate incident response and forensic analysis by masking other issues due to resource exhaustion.
Mitigation Recommendations
To mitigate CVE-2021-47365, organizations should: 1) Identify and inventory Linux systems running affected kernel versions with AFS enabled. 2) Apply the official patches or kernel updates that address this vulnerability as soon as they become available from trusted Linux distribution maintainers or upstream sources. 3) If immediate patching is not feasible, consider disabling AFS or limiting its usage to reduce exposure. 4) Monitor system memory usage closely on affected systems to detect abnormal increases that may indicate the leak is occurring. 5) Implement automated alerts for unusual memory consumption patterns to enable rapid response. 6) Conduct regular kernel updates and maintain a robust patch management process to prevent similar issues. 7) For critical systems, consider deploying redundancy and failover mechanisms to minimize downtime in case of memory exhaustion. 8) Engage with Linux vendor support channels for guidance on backporting fixes if using long-term support kernels. These steps go beyond generic advice by focusing on AFS-specific configurations and proactive monitoring tailored to the nature of this leak.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Norway, Denmark
CVE-2021-47365: Vulnerability in Linux Linux
Description
In the Linux kernel, the following vulnerability has been resolved: afs: Fix page leak There's a loop in afs_extend_writeback() that adds extra pages to a write we want to make to improve the efficiency of the writeback by making it larger. This loop stops, however, if we hit a page we can't write back from immediately, but it doesn't get rid of the page ref we speculatively acquired. This was caused by the removal of the cleanup loop when the code switched from using find_get_pages_contig() to xarray scanning as the latter only gets a single page at a time, not a batch. Fix this by putting the page on a ref on an early break from the loop. Unfortunately, we can't just add that page to the pagevec we're employing as we'll go through that and add those pages to the RPC call. This was found by the generic/074 test. It leaks ~4GiB of RAM each time it is run - which can be observed with "top".
AI-Powered Analysis
Technical Analysis
CVE-2021-47365 is a vulnerability identified in the Linux kernel's AFS (Andrew File System) implementation, specifically within the afs_extend_writeback() function. The vulnerability arises from a page reference leak caused by a logic error in the handling of pages during writeback operations. The function attempts to optimize writeback efficiency by extending the batch of pages to write; however, when it encounters a page that cannot be immediately written back, the loop breaks early but fails to properly release the speculative reference to that page. This results in a page reference leak, which over time causes significant memory consumption, as evidenced by the generic/074 test that leaks approximately 4 GiB of RAM per run. The root cause is linked to a code refactor where the cleanup loop was removed when switching from find_get_pages_contig(), which retrieved pages in batches, to xarray scanning, which retrieves pages one at a time. The fix involves ensuring that the page reference is properly accounted for on early loop exit without adding the page to the pagevec used for RPC calls, preventing the leak. While this vulnerability does not directly enable code execution or privilege escalation, the memory leak can degrade system performance and potentially lead to denial of service (DoS) conditions due to resource exhaustion. No known exploits are currently reported in the wild, and the vulnerability affects specific Linux kernel versions identified by commit hashes. The issue is primarily relevant to systems running the affected Linux kernel versions with AFS enabled and actively used.
Potential Impact
For European organizations, the impact of CVE-2021-47365 depends largely on their use of Linux systems with AFS enabled. Organizations relying on Linux servers for critical infrastructure, file sharing, or networked storage that utilize AFS could experience significant memory leaks leading to degraded system performance or crashes. This could disrupt business operations, especially in sectors such as telecommunications, research institutions, and enterprises with legacy AFS deployments. The memory leak could cause denial of service conditions, forcing unplanned downtime or requiring system reboots, impacting availability and operational continuity. While the vulnerability does not directly compromise confidentiality or integrity, the availability impact can be severe in environments with high workloads or limited memory resources. European organizations with large-scale Linux deployments or those in industries with stringent uptime requirements should be particularly cautious. Additionally, the leak could complicate incident response and forensic analysis by masking other issues due to resource exhaustion.
Mitigation Recommendations
To mitigate CVE-2021-47365, organizations should: 1) Identify and inventory Linux systems running affected kernel versions with AFS enabled. 2) Apply the official patches or kernel updates that address this vulnerability as soon as they become available from trusted Linux distribution maintainers or upstream sources. 3) If immediate patching is not feasible, consider disabling AFS or limiting its usage to reduce exposure. 4) Monitor system memory usage closely on affected systems to detect abnormal increases that may indicate the leak is occurring. 5) Implement automated alerts for unusual memory consumption patterns to enable rapid response. 6) Conduct regular kernel updates and maintain a robust patch management process to prevent similar issues. 7) For critical systems, consider deploying redundancy and failover mechanisms to minimize downtime in case of memory exhaustion. 8) Engage with Linux vendor support channels for guidance on backporting fixes if using long-term support kernels. These steps go beyond generic advice by focusing on AFS-specific configurations and proactive monitoring tailored to the nature of this leak.
Affected Countries
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-21T14:58:30.809Z
- Cisa Enriched
- true
- Cvss Version
- null
- State
- PUBLISHED
Threat ID: 682d9833c4522896dcbe8f32
Added to database: 5/21/2025, 9:09:07 AM
Last enriched: 6/30/2025, 11:58:24 AM
Last updated: 8/1/2025, 7:26:14 AM
Views: 12
Related Threats
CVE-2025-41242: Vulnerability in VMware Spring Framework
MediumCVE-2025-47206: CWE-787 in QNAP Systems Inc. File Station 5
HighCVE-2025-5296: CWE-59 Improper Link Resolution Before File Access ('Link Following') in Schneider Electric SESU
HighCVE-2025-6625: CWE-20 Improper Input Validation in Schneider Electric Modicon M340
HighCVE-2025-57703: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in Delta Electronics DIAEnergie
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.