Skip to main content

CVE-2024-27036: Vulnerability in Linux Linux

High
VulnerabilityCVE-2024-27036cvecve-2024-27036
Published: Wed May 01 2024 (05/01/2024, 12:53:46 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: cifs: Fix writeback data corruption cifs writeback doesn't correctly handle the case where cifs_extend_writeback() hits a point where it is considering an additional folio, but this would overrun the wsize - at which point it drops out of the xarray scanning loop and calls xas_pause(). The problem is that xas_pause() advances the loop counter - thereby skipping that page. What needs to happen is for xas_reset() to be called any time we decide we don't want to process the page we're looking at, but rather send the request we are building and start a new one. Fix this by copying and adapting the netfslib writepages code as a temporary measure, with cifs writeback intending to be offloaded to netfslib in the near future. This also fixes the issue with the use of filemap_get_folios_tag() causing retry of a bunch of pages which the extender already dealt with. This can be tested by creating, say, a 64K file somewhere not on cifs (otherwise copy-offload may get underfoot), mounting a cifs share with a wsize of 64000, copying the file to it and then comparing the original file and the copy: dd if=/dev/urandom of=/tmp/64K bs=64k count=1 mount //192.168.6.1/test /mnt -o user=...,pass=...,wsize=64000 cp /tmp/64K /mnt/64K cmp /tmp/64K /mnt/64K Without the fix, the cmp fails at position 64000 (or shortly thereafter).

AI-Powered Analysis

AILast updated: 06/29/2025, 14:40:14 UTC

Technical Analysis

CVE-2024-27036 is a vulnerability in the Linux kernel affecting the CIFS (Common Internet File System) client implementation, specifically related to the writeback mechanism. The issue arises in the function cifs_extend_writeback(), which manages the process of writing back data to a CIFS share. When this function encounters a scenario where adding an additional folio (a memory page structure) would exceed the configured write size (wsize), it prematurely exits the xarray scanning loop and calls xas_pause(). However, xas_pause() inadvertently advances the loop counter, causing the loop to skip the current page that should have been processed. This results in data corruption during writeback operations, as some pages are not correctly written to the CIFS share. The vulnerability also involves improper handling of filemap_get_folios_tag(), which leads to unnecessary retries of pages that have already been processed by the extender. The fix involves adapting code from netfslib's writepages to correctly reset the xarray iterator (using xas_reset()) whenever the process decides not to handle the current page and instead sends the current request and starts a new one. This correction prevents skipping pages and ensures data integrity during CIFS writeback operations. The vulnerability can be reproduced by copying a 64KB file to a CIFS-mounted share with a wsize of 64000 and comparing the source and destination files, where the mismatch occurs at or shortly after 64KB without the fix. This vulnerability is significant because it causes silent data corruption during file write operations over CIFS shares, which can lead to loss of data integrity without immediate detection. No known exploits are reported in the wild as of the publication date, and no CVSS score has been assigned yet.

Potential Impact

For European organizations, this vulnerability poses a risk primarily to environments using Linux systems as CIFS clients to access Windows or Samba file shares. Data corruption during writeback operations can lead to loss of critical business data, impacting data integrity and potentially causing operational disruptions. Sectors relying heavily on file sharing and storage, such as finance, healthcare, manufacturing, and public administration, could face significant challenges if corrupted files propagate through workflows or backups. The silent nature of the corruption means that affected organizations may not immediately detect the issue, increasing the risk of using or distributing corrupted data. Additionally, organizations with compliance obligations around data integrity and auditability (e.g., GDPR, NIS Directive) may face regulatory risks if data corruption leads to breaches of data accuracy or availability requirements. Although the vulnerability does not appear to allow remote code execution or privilege escalation, the integrity impact alone can have severe operational and reputational consequences. The lack of known exploits reduces immediate threat but does not eliminate the risk, especially as attackers or malware could leverage this flaw to sabotage data integrity in targeted attacks.

Mitigation Recommendations

European organizations should promptly apply the Linux kernel patches that address CVE-2024-27036 once available from their Linux distribution vendors. Until patches are applied, organizations should consider the following mitigations: 1) Avoid using large write sizes (wsize) for CIFS mounts, as the issue manifests when the writeback process attempts to handle folios exceeding the wsize; reducing wsize may reduce the risk of triggering the bug. 2) Implement rigorous file integrity monitoring on CIFS shares to detect unexpected data corruption early. 3) Use alternative file sharing protocols or clients where feasible, such as NFS or SMB3 implementations known to be unaffected. 4) Conduct thorough testing of critical file operations involving CIFS shares in staging environments to detect corruption issues. 5) Educate system administrators and users about the potential for silent data corruption and encourage verification of critical file copies. 6) Monitor Linux kernel mailing lists and vendor advisories for updates and backported patches. 7) Review backup and disaster recovery procedures to ensure that corrupted data does not propagate through backups. These steps go beyond generic patching advice by focusing on operational controls and configuration adjustments to reduce risk exposure until full remediation is in place.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-02-19T14:20:24.211Z
Cisa Enriched
true
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9829c4522896dcbe318f

Added to database: 5/21/2025, 9:08:57 AM

Last enriched: 6/29/2025, 2:40:14 PM

Last updated: 7/29/2025, 1:19:03 AM

Views: 8

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats