Skip to main content

CVE-2025-21907: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2025-21907cvecve-2025-21907
Published: Tue Apr 01 2025 (04/01/2025, 15:40:47 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: mm: memory-failure: update ttu flag inside unmap_poisoned_folio Patch series "mm: memory_failure: unmap poisoned folio during migrate properly", v3. Fix two bugs during folio migration if the folio is poisoned. This patch (of 3): Commit 6da6b1d4a7df ("mm/hwpoison: convert TTU_IGNORE_HWPOISON to TTU_HWPOISON") introduce TTU_HWPOISON to replace TTU_IGNORE_HWPOISON in order to stop send SIGBUS signal when accessing an error page after a memory error on a clean folio. However during page migration, anon folio must be set with TTU_HWPOISON during unmap_*(). For pagecache we need some policy just like the one in hwpoison_user_mappings to set this flag. So move this policy from hwpoison_user_mappings to unmap_poisoned_folio to handle this warning properly. Warning will be produced during unamp poison folio with the following log: ------------[ cut here ]------------ WARNING: CPU: 1 PID: 365 at mm/rmap.c:1847 try_to_unmap_one+0x8fc/0xd3c Modules linked in: CPU: 1 UID: 0 PID: 365 Comm: bash Tainted: G W 6.13.0-rc1-00018-gacdb4bbda7ab #42 Tainted: [W]=WARN Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015 pstate: 20400005 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : try_to_unmap_one+0x8fc/0xd3c lr : try_to_unmap_one+0x3dc/0xd3c Call trace: try_to_unmap_one+0x8fc/0xd3c (P) try_to_unmap_one+0x3dc/0xd3c (L) rmap_walk_anon+0xdc/0x1f8 rmap_walk+0x3c/0x58 try_to_unmap+0x88/0x90 unmap_poisoned_folio+0x30/0xa8 do_migrate_range+0x4a0/0x568 offline_pages+0x5a4/0x670 memory_block_action+0x17c/0x374 memory_subsys_offline+0x3c/0x78 device_offline+0xa4/0xd0 state_store+0x8c/0xf0 dev_attr_store+0x18/0x2c sysfs_kf_write+0x44/0x54 kernfs_fop_write_iter+0x118/0x1a8 vfs_write+0x3a8/0x4bc ksys_write+0x6c/0xf8 __arm64_sys_write+0x1c/0x28 invoke_syscall+0x44/0x100 el0_svc_common.constprop.0+0x40/0xe0 do_el0_svc+0x1c/0x28 el0_svc+0x30/0xd0 el0t_64_sync_handler+0xc8/0xcc el0t_64_sync+0x198/0x19c ---[ end trace 0000000000000000 ]--- [mawupeng1@huawei.com: unmap_poisoned_folio(): remove shadowed local `mapping', per Miaohe]

AI-Powered Analysis

AILast updated: 06/27/2025, 23:42:46 UTC

Technical Analysis

CVE-2025-21907 is a vulnerability identified in the Linux kernel's memory management subsystem, specifically related to the handling of poisoned memory pages during page migration. The issue arises in the function unmap_poisoned_folio(), which is responsible for unmapping memory pages that have been marked as 'poisoned' due to hardware memory errors. The vulnerability involves improper updating of the TTU (try to unmap) flags, particularly the transition from TTU_IGNORE_HWPOISON to TTU_HWPOISON, which controls whether a SIGBUS signal is sent when accessing error pages. During page migration, anonymous memory folios must be set with TTU_HWPOISON to correctly handle the poisoned state, but the previous implementation did not consistently apply this flag, especially for pagecache folios. This inconsistency can lead to warnings and potential instability, as evidenced by kernel warnings and stack traces logged during the unmap operation. The patch series addresses two bugs related to folio migration when the folio is poisoned, ensuring that the TTU_HWPOISON flag is correctly set during unmap_poisoned_folio(), and moving policy logic from hwpoison_user_mappings to unmap_poisoned_folio for better handling. The vulnerability affects specific Linux kernel commits and versions, including 6da6b1d4a7df8c35770186b53ef65d388398e139 and others. While no known exploits are reported in the wild, the issue can cause kernel warnings, potential crashes, or instability when memory errors occur and the kernel attempts to migrate poisoned pages. This vulnerability is technical and low-level, impacting kernel memory management robustness and error handling.

Potential Impact

For European organizations, the impact of CVE-2025-21907 primarily concerns systems running affected Linux kernel versions, especially those deployed in critical infrastructure, data centers, cloud environments, and enterprise servers. The vulnerability can lead to kernel warnings and potentially system instability or crashes when hardware memory errors occur and the kernel tries to migrate poisoned pages. This can affect system availability and reliability, particularly in environments with high memory usage or aging hardware prone to memory faults. While it does not directly lead to privilege escalation or data leakage, the instability could disrupt services, cause downtime, or complicate incident response. Organizations relying on Linux-based virtualization, container platforms, or cloud services may experience degraded performance or unexpected reboots if the kernel encounters poisoned memory pages. The absence of known exploits reduces immediate risk, but the vulnerability highlights the importance of robust memory error handling to maintain system integrity and uptime.

Mitigation Recommendations

European organizations should apply the official Linux kernel patches that address this vulnerability as soon as they become available. Specifically, updating to kernel versions that include the fix for unmap_poisoned_folio() and correct TTU flag handling is critical. System administrators should monitor kernel logs for warnings related to memory poisoning and page migration to detect potential issues early. Implementing hardware monitoring and predictive failure analysis tools can help identify failing memory modules before they cause kernel-level errors. For virtualized environments, ensuring that hypervisors and guest kernels are updated reduces the risk of propagation of memory errors. Additionally, organizations should maintain rigorous patch management processes to deploy kernel updates promptly. Testing kernel updates in staging environments is advised to ensure compatibility and stability. Finally, consider deploying memory error correction technologies (ECC RAM) and hardware diagnostics to minimize the occurrence of poisoned memory pages.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2024-12-29T08:45:45.786Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9820c4522896dcbdd393

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

Last enriched: 6/27/2025, 11:42:46 PM

Last updated: 7/27/2025, 11:44:08 PM

Views: 10

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